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 n;
    scanf("%d",&n);
    int a[n];
    int x[n][n], y[n][n];
    for(int i = 0; i < n; i++){
        scanf("%d",&a[i]);
        for(int j = 0; j < a[i]; j++)
            scanf("%d%d",&x[i][j],&y[i][j]);
    }
    int ans = 0;
    for(int bit = 1; bit < (1 << n); bit++){
        int flag = 1;
        int count = 0;
        for(int i = 0; i < n && flag; i++){
            if(bit & (1 << i)){
                count ++;
                for(int j = 0; j < a[i] && flag; j++){
                    if((bit & (1 << (x[i][j] - 1))) != (y[i][j] << (x[i][j] - 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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$296, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, -328(%rbp)
	leaq	-156(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-156(%rbp), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -120(%rbp)
	movslq	%edx, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	movslq	%edx, %rax
	movq	%rax, -288(%rbp)
	movq	$0, -280(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L2:
	cmpq	%rcx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L4
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -112(%rbp)
	movl	-156(%rbp), %esi
	movl	-156(%rbp), %edi
	movslq	%esi, %rax
	subq	$1, %rax
	movq	%rax, -104(%rbp)
	movslq	%esi, %rax
	movq	%rax, -304(%rbp)
	movq	$0, -296(%rbp)
	movslq	%esi, %rax
	leaq	0(,%rax,4), %r12
	movslq	%edi, %rax
	subq	$1, %rax
	movq	%rax, -96(%rbp)
	movslq	%esi, %rax
	movq	%rax, -176(%rbp)
	movq	$0, -168(%rbp)
	movslq	%edi, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	movq	-176(%rbp), %r8
	movq	-168(%rbp), %r9
	movq	%r9, %rdx
	imulq	%r14, %rdx
	movq	%r8, %rax
	imulq	%r15, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r8, %rax
	mulq	%r14
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rax
	movq	%rax, -192(%rbp)
	movq	$0, -184(%rbp)
	movslq	%edi, %rax
	movq	%rax, -208(%rbp)
	movq	$0, -200(%rbp)
	movq	-192(%rbp), %r9
	movq	-184(%rbp), %r10
	movq	%r10, %rdx
	movq	-208(%rbp), %r14
	movq	-200(%rbp), %r15
	imulq	%r14, %rdx
	movq	%r15, %rax
	imulq	%r9, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r9, %rax
	mulq	%r14
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rdx
	movslq	%edi, %rax
	imulq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -88(%rbp)
	movl	-156(%rbp), %esi
	movl	-156(%rbp), %edi
	movslq	%esi, %rax
	subq	$1, %rax
	movq	%rax, -80(%rbp)
	movslq	%esi, %rax
	movq	%rax, -320(%rbp)
	movq	$0, -312(%rbp)
	movslq	%esi, %rax
	leaq	0(,%rax,4), %rbx
	movslq	%edi, %rax
	subq	$1, %rax
	movq	%rax, -72(%rbp)
	movslq	%esi, %rax
	movq	%rax, -224(%rbp)
	movq	$0, -216(%rbp)
	movslq	%edi, %rax
	movq	%rax, -240(%rbp)
	movq	$0, -232(%rbp)
	movq	-224(%rbp), %r10
	movq	-216(%rbp), %r11
	movq	%r11, %rdx
	movq	-240(%rbp), %r14
	movq	-232(%rbp), %r15
	imulq	%r14, %rdx
	movq	%r15, %rax
	imulq	%r10, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r10, %rax
	mulq	%r14
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rax
	movq	%rax, -256(%rbp)
	movq	$0, -248(%rbp)
	movslq	%edi, %rax
	movq	%rax, -272(%rbp)
	movq	$0, -264(%rbp)
	movq	-256(%rbp), %r10
	movq	-248(%rbp), %r11
	movq	%r11, %rdx
	movq	-272(%rbp), %r8
	movq	-264(%rbp), %r9
	imulq	%r8, %rdx
	movq	%r9, %rax
	imulq	%r10, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r10, %rax
	mulq	%r8
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rdx
	movslq	%edi, %rax
	imulq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L8:
	cmpq	%rdx, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L9:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L10
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L10:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -152(%rbp)
	jmp	.L11
.L14:
	movl	-152(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-112(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -148(%rbp)
	jmp	.L12
.L13:
	movq	%rbx, %rdx
	shrq	$2, %rdx
	movl	-148(%rbp), %eax
	movslq	%eax, %rcx
	movl	-152(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	movq	-64(%rbp), %rax
	addq	%rax, %rdx
	movq	%r12, %rcx
	shrq	$2, %rcx
	movl	-148(%rbp), %eax
	movslq	%eax, %rsi
	movl	-152(%rbp), %eax
	cltq
	imulq	%rcx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rcx
	movq	-88(%rbp), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -148(%rbp)
.L12:
	movq	-112(%rbp), %rax
	movl	-152(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	%eax, -148(%rbp)
	jl	.L13
	addl	$1, -152(%rbp)
.L11:
	movl	-156(%rbp), %eax
	cmpl	%eax, -152(%rbp)
	jl	.L14
	movl	$0, -144(%rbp)
	movl	$1, -140(%rbp)
	jmp	.L15
.L24:
	movl	$1, -136(%rbp)
	movl	$0, -132(%rbp)
	movl	$0, -128(%rbp)
	jmp	.L16
.L22:
	movl	-128(%rbp), %eax
	movl	-140(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L17
	addl	$1, -132(%rbp)
	movl	$0, -124(%rbp)
	jmp	.L18
.L20:
	movq	%r12, %rcx
	shrq	$2, %rcx
	movq	-88(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rsi
	movl	-128(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movl	(%rax,%rdx,4), %eax
	subl	$1, %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	andl	-140(%rbp), %eax
	movl	%eax, %edx
	movq	%rbx, %rsi
	shrq	$2, %rsi
	movq	-64(%rbp), %rax
	movl	-124(%rbp), %ecx
	movslq	%ecx, %rdi
	movl	-128(%rbp), %ecx
	movslq	%ecx, %rcx
	imulq	%rsi, %rcx
	addq	%rdi, %rcx
	movl	(%rax,%rcx,4), %esi
	movq	%r12, %rdi
	shrq	$2, %rdi
	movq	-88(%rbp), %rax
	movl	-124(%rbp), %ecx
	movslq	%ecx, %r8
	movl	-128(%rbp), %ecx
	movslq	%ecx, %rcx
	imulq	%rdi, %rcx
	addq	%r8, %rcx
	movl	(%rax,%rcx,4), %eax
	subl	$1, %eax
	movl	%eax, %ecx
	sall	%cl, %esi
	movl	%esi, %eax
	cmpl	%eax, %edx
	je	.L19
	movl	$0, -136(%rbp)
.L19:
	addl	$1, -124(%rbp)
.L18:
	movq	-112(%rbp), %rax
	movl	-128(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	%eax, -124(%rbp)
	jge	.L17
	cmpl	$0, -136(%rbp)
	jne	.L20
.L17:
	addl	$1, -128(%rbp)
.L16:
	movl	-156(%rbp), %eax
	cmpl	%eax, -128(%rbp)
	jge	.L21
	cmpl	$0, -136(%rbp)
	jne	.L22
.L21:
	cmpl	$0, -136(%rbp)
	je	.L23
	movl	-144(%rbp), %eax
	cmpl	-132(%rbp), %eax
	jge	.L23
	movl	-132(%rbp), %eax
	movl	%eax, -144(%rbp)
.L23:
	addl	$1, -140(%rbp)
.L15:
	movl	-156(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	cmpl	%eax, -140(%rbp)
	jl	.L24
	movl	-144(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-328(%rbp), %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-60(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-60(%rbp), %rdx
	movq	%rsp, %rsi
	leaq	0(,%rdx,4), %rax
	movq	%rdx, %r11
	movq	%rax, -112(%rbp)
	addq	$15, %rax
	movq	%rax, %rcx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rcx
	cmpq	%rsi, %rsp
	je	.L3
.L53:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L53
.L3:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L54
.L4:
	imulq	%rdx, %rdx
	movq	%rsp, -104(%rbp)
	movq	%rsp, %rcx
	leaq	15(,%rdx,4), %rax
	movq	%rax, %rsi
	movq	%rax, %rdx
	andq	$-4096, %rsi
	andq	$-16, %rdx
	subq	%rsi, %rcx
.L5:
	cmpq	%rcx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L54:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L4
.L6:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L55
.L7:
	movq	%rax, %rdx
	movq	%rsp, %rcx
	andq	$-4096, %rax
	movq	%rsp, %r15
	andq	$-16, %rdx
	subq	%rax, %rcx
.L8:
	cmpq	%rcx, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L55:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L7
.L9:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L10
	orq	$0, -8(%rsp,%rax)
.L10:
	movq	%rsp, %r14
	testl	%r11d, %r11d
	jle	.L11
	movq	-112(%rbp), %rax
	movq	-104(%rbp), %rbx
	movq	%r15, -88(%rbp)
	xorl	%r13d, %r13d
	movl	$0, -68(%rbp)
	shrq	$2, %rax
	movq	%r14, -96(%rbp)
	movq	%rax, -80(%rbp)
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%rbx, %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%rbx), %eax
	testl	%eax, %eax
	jle	.L15
	movq	-88(%rbp), %rax
	leaq	0(,%r13,4), %rdx
	xorl	%r14d, %r14d
	leaq	(%rax,%rdx), %r12
	movq	-96(%rbp), %rax
	leaq	(%rax,%rdx), %r15
	.p2align 4,,10
	.p2align 3
.L14:
	movq	%r15, %rdx
	movq	%r12, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	addl	$1, %r14d
	addq	$4, %r12
	addq	$4, %r15
	cmpl	%r14d, (%rbx)
	jg	.L14
.L15:
	addl	$1, -68(%rbp)
	movl	-60(%rbp), %r11d
	addq	$4, %rbx
	movl	-68(%rbp), %eax
	addq	-80(%rbp), %r13
	cmpl	%eax, %r11d
	jg	.L13
	movq	-88(%rbp), %r15
	movq	-96(%rbp), %r14
.L11:
	movl	$1, %eax
	movl	%r11d, %ecx
	sall	%cl, %eax
	movl	%eax, -80(%rbp)
	cmpl	$1, %eax
	jle	.L27
	movq	-112(%rbp), %r9
	movl	$1, %edi
	movl	$1, %ebx
	movl	$0, -88(%rbp)
	shrq	$2, %r9
	.p2align 4,,10
	.p2align 3
.L17:
	testl	%r11d, %r11d
	jle	.L20
	movq	-104(%rbp), %r10
	xorl	%r8d, %r8d
	xorl	%esi, %esi
	xorl	%r13d, %r13d
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L50:
	cmpl	%esi, %r11d
	jle	.L56
.L23:
	addq	$4, %r10
	addq	%r9, %r8
.L25:
	movl	%esi, %ecx
	movl	%edi, %eax
	addl	$1, %esi
	sarl	%cl, %eax
	testb	$1, %al
	je	.L50
	movl	(%r10), %eax
	addl	$1, %r13d
	testl	%eax, %eax
	jle	.L50
	subl	$1, %eax
	movl	%esi, -68(%rbp)
	leaq	0(,%r8,4), %rdx
	leaq	1(%r8,%rax), %r12
	salq	$2, %r12
.L21:
	movl	(%r15,%rdx), %eax
	movl	(%r14,%rdx), %esi
	leal	-1(%rax), %ecx
	movl	%ebx, %eax
	sall	%cl, %eax
	sall	%cl, %esi
	andl	%edi, %eax
	cmpl	%esi, %eax
	je	.L57
.L20:
	addl	$1, %edi
	cmpl	%edi, -80(%rbp)
	jne	.L17
.L16:
	movl	-88(%rbp), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L58
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L57:
	.cfi_restore_state
	addq	$4, %rdx
	cmpq	%rdx, %r12
	jne	.L21
	movl	-68(%rbp), %esi
	cmpl	%esi, %r11d
	jg	.L23
	.p2align 4,,10
	.p2align 3
.L56:
	movl	-88(%rbp), %eax
	cmpl	%r13d, %eax
	cmovge	%eax, %r13d
	movl	%r13d, -88(%rbp)
	jmp	.L20
.L27:
	movl	$0, -88(%rbp)
	jmp	.L16
.L58:
	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	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-60(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-60(%rbp), %rdx
	movq	%rsp, %rsi
	leaq	0(,%rdx,4), %rax
	movq	%rdx, %r11
	movq	%rax, -112(%rbp)
	addq	$15, %rax
	movq	%rax, %rcx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rcx
	cmpq	%rsi, %rsp
	je	.L3
.L53:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L53
.L3:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L54
.L4:
	imulq	%rdx, %rdx
	movq	%rsp, -104(%rbp)
	movq	%rsp, %rcx
	leaq	15(,%rdx,4), %rax
	movq	%rax, %rsi
	movq	%rax, %rdx
	andq	$-4096, %rsi
	andq	$-16, %rdx
	subq	%rsi, %rcx
.L5:
	cmpq	%rcx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L54:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L4
.L6:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L55
.L7:
	movq	%rax, %rdx
	movq	%rsp, %rcx
	andq	$-4096, %rax
	movq	%rsp, %r15
	andq	$-16, %rdx
	subq	%rax, %rcx
.L8:
	cmpq	%rcx, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L55:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L7
.L9:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L10
	orq	$0, -8(%rsp,%rax)
.L10:
	movq	%rsp, %r14
	testl	%r11d, %r11d
	jle	.L11
	movq	-112(%rbp), %rax
	movq	-104(%rbp), %rbx
	movq	%r15, -88(%rbp)
	xorl	%r13d, %r13d
	movl	$0, -68(%rbp)
	shrq	$2, %rax
	movq	%r14, -96(%rbp)
	movq	%rax, -80(%rbp)
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%rbx, %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%rbx), %eax
	testl	%eax, %eax
	jle	.L15
	movq	-88(%rbp), %rax
	leaq	0(,%r13,4), %rdx
	xorl	%r14d, %r14d
	leaq	(%rax,%rdx), %r12
	movq	-96(%rbp), %rax
	leaq	(%rax,%rdx), %r15
	.p2align 4,,10
	.p2align 3
.L14:
	movq	%r15, %rdx
	movq	%r12, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	addl	$1, %r14d
	addq	$4, %r12
	addq	$4, %r15
	cmpl	%r14d, (%rbx)
	jg	.L14
.L15:
	addl	$1, -68(%rbp)
	movl	-60(%rbp), %r11d
	addq	$4, %rbx
	movl	-68(%rbp), %eax
	addq	-80(%rbp), %r13
	cmpl	%eax, %r11d
	jg	.L13
	movq	-88(%rbp), %r15
	movq	-96(%rbp), %r14
.L11:
	movl	$1, %eax
	movl	%r11d, %ecx
	sall	%cl, %eax
	movl	%eax, -80(%rbp)
	cmpl	$1, %eax
	jle	.L27
	movq	-112(%rbp), %r9
	movl	$1, %edi
	movl	$1, %ebx
	movl	$0, -88(%rbp)
	shrq	$2, %r9
	.p2align 4,,10
	.p2align 3
.L17:
	testl	%r11d, %r11d
	jle	.L20
	movq	-104(%rbp), %r10
	xorl	%r8d, %r8d
	xorl	%esi, %esi
	xorl	%r13d, %r13d
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L50:
	cmpl	%esi, %r11d
	jle	.L56
.L23:
	addq	$4, %r10
	addq	%r9, %r8
.L25:
	movl	%esi, %ecx
	movl	%edi, %eax
	addl	$1, %esi
	sarl	%cl, %eax
	testb	$1, %al
	je	.L50
	movl	(%r10), %eax
	addl	$1, %r13d
	testl	%eax, %eax
	jle	.L50
	subl	$1, %eax
	movl	%esi, -68(%rbp)
	leaq	0(,%r8,4), %rdx
	leaq	1(%r8,%rax), %r12
	salq	$2, %r12
.L21:
	movl	(%r15,%rdx), %eax
	movl	(%r14,%rdx), %esi
	leal	-1(%rax), %ecx
	movl	%ebx, %eax
	sall	%cl, %eax
	sall	%cl, %esi
	andl	%edi, %eax
	cmpl	%esi, %eax
	je	.L57
.L20:
	addl	$1, %edi
	cmpl	%edi, -80(%rbp)
	jne	.L17
.L16:
	movl	-88(%rbp), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L58
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L57:
	.cfi_restore_state
	addq	$4, %rdx
	cmpq	%rdx, %r12
	jne	.L21
	movl	-68(%rbp), %esi
	cmpl	%esi, %r11d
	jg	.L23
	.p2align 4,,10
	.p2align 3
.L56:
	movl	-88(%rbp), %eax
	cmpl	%r13d, %eax
	cmovge	%eax, %r13d
	movl	%r13d, -88(%rbp)
	jmp	.L20
.L27:
	movl	$0, -88(%rbp)
	jmp	.L16
.L58:
	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 n;
    scanf("%d",&n);
    int a[n];
    int x[n][n], y[n][n];
    for(int i = 0; i < n; i++){
        scanf("%d",&a[i]);
        for(int j = 0; j < a[i]; j++)
            scanf("%d%d",&x[i][j],&y[i][j]);
    }
    int ans = 0;
    for(int bit = 1; bit < (1 << n); bit++){
        int flag = 1;
        int count = 0;
        for(int i = 0; i < n && flag; i++){
            if(bit & (1 << i)){
                count ++;
                for(int j = 0; j < a[i] && flag; j++){
                    if((bit & (1 << (x[i][j] - 1))) != (y[i][j] << (x[i][j] - 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 n;
    scanf("%d",&n);
    int a[n];
    int x[n][n], y[n][n];
    for(int i = 0; i < n; i++){
        scanf("%d",&a[i]);
        for(int j = 0; j < a[i]; j++)
            scanf("%d%d",&x[i][j],&y[i][j]);
    }
    int ans = 0;
    for(int bit = 1; bit < (1 << n); bit++){
        int flag = 1;
        int count = 0;
        for(int i = 0; i < n && flag; i++){
            if(bit & (1 << i)){
                count ++;
                for(int j = 0; j < a[i] && flag; j++){
                    if((bit & (1 << (x[i][j] - 1))) != (y[i][j] << (x[i][j] - 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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$296, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, -328(%rbp)
	leaq	-156(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-156(%rbp), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -120(%rbp)
	movslq	%edx, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	movslq	%edx, %rax
	movq	%rax, -288(%rbp)
	movq	$0, -280(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L2:
	cmpq	%rcx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L4
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -112(%rbp)
	movl	-156(%rbp), %esi
	movl	-156(%rbp), %edi
	movslq	%esi, %rax
	subq	$1, %rax
	movq	%rax, -104(%rbp)
	movslq	%esi, %rax
	movq	%rax, -304(%rbp)
	movq	$0, -296(%rbp)
	movslq	%esi, %rax
	leaq	0(,%rax,4), %r12
	movslq	%edi, %rax
	subq	$1, %rax
	movq	%rax, -96(%rbp)
	movslq	%esi, %rax
	movq	%rax, -176(%rbp)
	movq	$0, -168(%rbp)
	movslq	%edi, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	movq	-176(%rbp), %r8
	movq	-168(%rbp), %r9
	movq	%r9, %rdx
	imulq	%r14, %rdx
	movq	%r8, %rax
	imulq	%r15, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r8, %rax
	mulq	%r14
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rax
	movq	%rax, -192(%rbp)
	movq	$0, -184(%rbp)
	movslq	%edi, %rax
	movq	%rax, -208(%rbp)
	movq	$0, -200(%rbp)
	movq	-192(%rbp), %r9
	movq	-184(%rbp), %r10
	movq	%r10, %rdx
	movq	-208(%rbp), %r14
	movq	-200(%rbp), %r15
	imulq	%r14, %rdx
	movq	%r15, %rax
	imulq	%r9, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r9, %rax
	mulq	%r14
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rdx
	movslq	%edi, %rax
	imulq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -88(%rbp)
	movl	-156(%rbp), %esi
	movl	-156(%rbp), %edi
	movslq	%esi, %rax
	subq	$1, %rax
	movq	%rax, -80(%rbp)
	movslq	%esi, %rax
	movq	%rax, -320(%rbp)
	movq	$0, -312(%rbp)
	movslq	%esi, %rax
	leaq	0(,%rax,4), %rbx
	movslq	%edi, %rax
	subq	$1, %rax
	movq	%rax, -72(%rbp)
	movslq	%esi, %rax
	movq	%rax, -224(%rbp)
	movq	$0, -216(%rbp)
	movslq	%edi, %rax
	movq	%rax, -240(%rbp)
	movq	$0, -232(%rbp)
	movq	-224(%rbp), %r10
	movq	-216(%rbp), %r11
	movq	%r11, %rdx
	movq	-240(%rbp), %r14
	movq	-232(%rbp), %r15
	imulq	%r14, %rdx
	movq	%r15, %rax
	imulq	%r10, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r10, %rax
	mulq	%r14
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rax
	movq	%rax, -256(%rbp)
	movq	$0, -248(%rbp)
	movslq	%edi, %rax
	movq	%rax, -272(%rbp)
	movq	$0, -264(%rbp)
	movq	-256(%rbp), %r10
	movq	-248(%rbp), %r11
	movq	%r11, %rdx
	movq	-272(%rbp), %r8
	movq	-264(%rbp), %r9
	imulq	%r8, %rdx
	movq	%r9, %rax
	imulq	%r10, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r10, %rax
	mulq	%r8
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rdx
	movslq	%edi, %rax
	imulq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L8:
	cmpq	%rdx, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L9:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L10
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L10:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -152(%rbp)
	jmp	.L11
.L14:
	movl	-152(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-112(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -148(%rbp)
	jmp	.L12
.L13:
	movq	%rbx, %rdx
	shrq	$2, %rdx
	movl	-148(%rbp), %eax
	movslq	%eax, %rcx
	movl	-152(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	movq	-64(%rbp), %rax
	addq	%rax, %rdx
	movq	%r12, %rcx
	shrq	$2, %rcx
	movl	-148(%rbp), %eax
	movslq	%eax, %rsi
	movl	-152(%rbp), %eax
	cltq
	imulq	%rcx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rcx
	movq	-88(%rbp), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -148(%rbp)
.L12:
	movq	-112(%rbp), %rax
	movl	-152(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	%eax, -148(%rbp)
	jl	.L13
	addl	$1, -152(%rbp)
.L11:
	movl	-156(%rbp), %eax
	cmpl	%eax, -152(%rbp)
	jl	.L14
	movl	$0, -144(%rbp)
	movl	$1, -140(%rbp)
	jmp	.L15
.L24:
	movl	$1, -136(%rbp)
	movl	$0, -132(%rbp)
	movl	$0, -128(%rbp)
	jmp	.L16
.L22:
	movl	-128(%rbp), %eax
	movl	-140(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L17
	addl	$1, -132(%rbp)
	movl	$0, -124(%rbp)
	jmp	.L18
.L20:
	movq	%r12, %rcx
	shrq	$2, %rcx
	movq	-88(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rsi
	movl	-128(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movl	(%rax,%rdx,4), %eax
	subl	$1, %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	andl	-140(%rbp), %eax
	movl	%eax, %edx
	movq	%rbx, %rsi
	shrq	$2, %rsi
	movq	-64(%rbp), %rax
	movl	-124(%rbp), %ecx
	movslq	%ecx, %rdi
	movl	-128(%rbp), %ecx
	movslq	%ecx, %rcx
	imulq	%rsi, %rcx
	addq	%rdi, %rcx
	movl	(%rax,%rcx,4), %esi
	movq	%r12, %rdi
	shrq	$2, %rdi
	movq	-88(%rbp), %rax
	movl	-124(%rbp), %ecx
	movslq	%ecx, %r8
	movl	-128(%rbp), %ecx
	movslq	%ecx, %rcx
	imulq	%rdi, %rcx
	addq	%r8, %rcx
	movl	(%rax,%rcx,4), %eax
	subl	$1, %eax
	movl	%eax, %ecx
	sall	%cl, %esi
	movl	%esi, %eax
	cmpl	%eax, %edx
	je	.L19
	movl	$0, -136(%rbp)
.L19:
	addl	$1, -124(%rbp)
.L18:
	movq	-112(%rbp), %rax
	movl	-128(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	%eax, -124(%rbp)
	jge	.L17
	cmpl	$0, -136(%rbp)
	jne	.L20
.L17:
	addl	$1, -128(%rbp)
.L16:
	movl	-156(%rbp), %eax
	cmpl	%eax, -128(%rbp)
	jge	.L21
	cmpl	$0, -136(%rbp)
	jne	.L22
.L21:
	cmpl	$0, -136(%rbp)
	je	.L23
	movl	-144(%rbp), %eax
	cmpl	-132(%rbp), %eax
	jge	.L23
	movl	-132(%rbp), %eax
	movl	%eax, -144(%rbp)
.L23:
	addl	$1, -140(%rbp)
.L15:
	movl	-156(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	cmpl	%eax, -140(%rbp)
	jl	.L24
	movl	-144(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-328(%rbp), %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$296, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, -328(%rbp)
	leaq	-156(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-156(%rbp), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -120(%rbp)
	movslq	%edx, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	movslq	%edx, %rax
	movq	%rax, -288(%rbp)
	movq	$0, -280(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L2:
	cmpq	%rcx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L4
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -112(%rbp)
	movl	-156(%rbp), %esi
	movl	-156(%rbp), %edi
	movslq	%esi, %rax
	subq	$1, %rax
	movq	%rax, -104(%rbp)
	movslq	%esi, %rax
	movq	%rax, -304(%rbp)
	movq	$0, -296(%rbp)
	movslq	%esi, %rax
	leaq	0(,%rax,4), %r12
	movslq	%edi, %rax
	subq	$1, %rax
	movq	%rax, -96(%rbp)
	movslq	%esi, %rax
	movq	%rax, -176(%rbp)
	movq	$0, -168(%rbp)
	movslq	%edi, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	movq	-176(%rbp), %r8
	movq	-168(%rbp), %r9
	movq	%r9, %rdx
	imulq	%r14, %rdx
	movq	%r8, %rax
	imulq	%r15, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r8, %rax
	mulq	%r14
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rax
	movq	%rax, -192(%rbp)
	movq	$0, -184(%rbp)
	movslq	%edi, %rax
	movq	%rax, -208(%rbp)
	movq	$0, -200(%rbp)
	movq	-192(%rbp), %r9
	movq	-184(%rbp), %r10
	movq	%r10, %rdx
	movq	-208(%rbp), %r14
	movq	-200(%rbp), %r15
	imulq	%r14, %rdx
	movq	%r15, %rax
	imulq	%r9, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r9, %rax
	mulq	%r14
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rdx
	movslq	%edi, %rax
	imulq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -88(%rbp)
	movl	-156(%rbp), %esi
	movl	-156(%rbp), %edi
	movslq	%esi, %rax
	subq	$1, %rax
	movq	%rax, -80(%rbp)
	movslq	%esi, %rax
	movq	%rax, -320(%rbp)
	movq	$0, -312(%rbp)
	movslq	%esi, %rax
	leaq	0(,%rax,4), %rbx
	movslq	%edi, %rax
	subq	$1, %rax
	movq	%rax, -72(%rbp)
	movslq	%esi, %rax
	movq	%rax, -224(%rbp)
	movq	$0, -216(%rbp)
	movslq	%edi, %rax
	movq	%rax, -240(%rbp)
	movq	$0, -232(%rbp)
	movq	-224(%rbp), %r10
	movq	-216(%rbp), %r11
	movq	%r11, %rdx
	movq	-240(%rbp), %r14
	movq	-232(%rbp), %r15
	imulq	%r14, %rdx
	movq	%r15, %rax
	imulq	%r10, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r10, %rax
	mulq	%r14
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rax
	movq	%rax, -256(%rbp)
	movq	$0, -248(%rbp)
	movslq	%edi, %rax
	movq	%rax, -272(%rbp)
	movq	$0, -264(%rbp)
	movq	-256(%rbp), %r10
	movq	-248(%rbp), %r11
	movq	%r11, %rdx
	movq	-272(%rbp), %r8
	movq	-264(%rbp), %r9
	imulq	%r8, %rdx
	movq	%r9, %rax
	imulq	%r10, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r10, %rax
	mulq	%r8
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rdx
	movslq	%edi, %rax
	imulq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L8:
	cmpq	%rdx, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L9:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L10
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L10:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -152(%rbp)
	jmp	.L11
.L14:
	movl	-152(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-112(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -148(%rbp)
	jmp	.L12
.L13:
	movq	%rbx, %rdx
	shrq	$2, %rdx
	movl	-148(%rbp), %eax
	movslq	%eax, %rcx
	movl	-152(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	movq	-64(%rbp), %rax
	addq	%rax, %rdx
	movq	%r12, %rcx
	shrq	$2, %rcx
	movl	-148(%rbp), %eax
	movslq	%eax, %rsi
	movl	-152(%rbp), %eax
	cltq
	imulq	%rcx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rcx
	movq	-88(%rbp), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -148(%rbp)
.L12:
	movq	-112(%rbp), %rax
	movl	-152(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	%eax, -148(%rbp)
	jl	.L13
	addl	$1, -152(%rbp)
.L11:
	movl	-156(%rbp), %eax
	cmpl	%eax, -152(%rbp)
	jl	.L14
	movl	$0, -144(%rbp)
	movl	$1, -140(%rbp)
	jmp	.L15
.L24:
	movl	$1, -136(%rbp)
	movl	$0, -132(%rbp)
	movl	$0, -128(%rbp)
	jmp	.L16
.L22:
	movl	-128(%rbp), %eax
	movl	-140(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L17
	addl	$1, -132(%rbp)
	movl	$0, -124(%rbp)
	jmp	.L18
.L20:
	movq	%r12, %rcx
	shrq	$2, %rcx
	movq	-88(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rsi
	movl	-128(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movl	(%rax,%rdx,4), %eax
	subl	$1, %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	andl	-140(%rbp), %eax
	movl	%eax, %edx
	movq	%rbx, %rsi
	shrq	$2, %rsi
	movq	-64(%rbp), %rax
	movl	-124(%rbp), %ecx
	movslq	%ecx, %rdi
	movl	-128(%rbp), %ecx
	movslq	%ecx, %rcx
	imulq	%rsi, %rcx
	addq	%rdi, %rcx
	movl	(%rax,%rcx,4), %esi
	movq	%r12, %rdi
	shrq	$2, %rdi
	movq	-88(%rbp), %rax
	movl	-124(%rbp), %ecx
	movslq	%ecx, %r8
	movl	-128(%rbp), %ecx
	movslq	%ecx, %rcx
	imulq	%rdi, %rcx
	addq	%r8, %rcx
	movl	(%rax,%rcx,4), %eax
	subl	$1, %eax
	movl	%eax, %ecx
	sall	%cl, %esi
	movl	%esi, %eax
	cmpl	%eax, %edx
	je	.L19
	movl	$0, -136(%rbp)
.L19:
	addl	$1, -124(%rbp)
.L18:
	movq	-112(%rbp), %rax
	movl	-128(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	%eax, -124(%rbp)
	jge	.L17
	cmpl	$0, -136(%rbp)
	jne	.L20
.L17:
	addl	$1, -128(%rbp)
.L16:
	movl	-156(%rbp), %eax
	cmpl	%eax, -128(%rbp)
	jge	.L21
	cmpl	$0, -136(%rbp)
	jne	.L22
.L21:
	cmpl	$0, -136(%rbp)
	je	.L23
	movl	-144(%rbp), %eax
	cmpl	-132(%rbp), %eax
	jge	.L23
	movl	-132(%rbp), %eax
	movl	%eax, -144(%rbp)
.L23:
	addl	$1, -140(%rbp)
.L15:
	movl	-156(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	cmpl	%eax, -140(%rbp)
	jl	.L24
	movl	-144(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-328(%rbp), %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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:
