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,a,x,y,s[16],t[16],i,j,m=0;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&a);
    s[i]=0;
    t[i]=0;
    for(j=0;j<a;j++){
      scanf("%d",&x);
      scanf("%d",&y);
      x--;
      s[i]|=1<<x;
      t[i]|=(y&1)<<x;
    }
  }
  for(i=(1<<n)-1;i>0;i--){
    x=0;
    for(j=0;j<n;j++){
      if((i>>j)&1){
        x++;
        if(i&s[j]^t[j]) break;
      }
    }
    if((j==n)&(m<x)) m=x;
  }
  printf("%d",m);
  return(0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.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	$176, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -148(%rbp)
	leaq	-172(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -156(%rbp)
	jmp	.L2
.L5:
	leaq	-168(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-156(%rbp), %eax
	cltq
	movl	$0, -144(%rbp,%rax,4)
	movl	-156(%rbp), %eax
	cltq
	movl	$0, -80(%rbp,%rax,4)
	movl	$0, -152(%rbp)
	jmp	.L3
.L4:
	leaq	-164(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-160(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-164(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -164(%rbp)
	movl	-156(%rbp), %eax
	cltq
	movl	-144(%rbp,%rax,4), %edx
	movl	-164(%rbp), %eax
	movl	$1, %esi
	movl	%eax, %ecx
	sall	%cl, %esi
	movl	%esi, %eax
	orl	%eax, %edx
	movl	-156(%rbp), %eax
	cltq
	movl	%edx, -144(%rbp,%rax,4)
	movl	-156(%rbp), %eax
	cltq
	movl	-80(%rbp,%rax,4), %esi
	movl	-160(%rbp), %eax
	andl	$1, %eax
	movl	%eax, %edx
	movl	-164(%rbp), %eax
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	orl	%eax, %esi
	movl	%esi, %edx
	movl	-156(%rbp), %eax
	cltq
	movl	%edx, -80(%rbp,%rax,4)
	addl	$1, -152(%rbp)
.L3:
	movl	-168(%rbp), %eax
	cmpl	%eax, -152(%rbp)
	jl	.L4
	addl	$1, -156(%rbp)
.L2:
	movl	-172(%rbp), %eax
	cmpl	%eax, -156(%rbp)
	jl	.L5
	movl	-172(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	subl	$1, %eax
	movl	%eax, -156(%rbp)
	jmp	.L6
.L12:
	movl	$0, -164(%rbp)
	movl	$0, -152(%rbp)
	jmp	.L7
.L10:
	movl	-152(%rbp), %eax
	movl	-156(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L8
	movl	-164(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -164(%rbp)
	movl	-152(%rbp), %eax
	cltq
	movl	-144(%rbp,%rax,4), %eax
	andl	-156(%rbp), %eax
	movl	%eax, %edx
	movl	-152(%rbp), %eax
	cltq
	movl	-80(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L15
.L8:
	addl	$1, -152(%rbp)
.L7:
	movl	-172(%rbp), %eax
	cmpl	%eax, -152(%rbp)
	jl	.L10
	jmp	.L9
.L15:
	nop
.L9:
	movl	-172(%rbp), %eax
	cmpl	%eax, -152(%rbp)
	sete	%dl
	movl	-164(%rbp), %eax
	cmpl	%eax, -148(%rbp)
	setl	%al
	andl	%edx, %eax
	testb	%al, %al
	je	.L11
	movl	-164(%rbp), %eax
	movl	%eax, -148(%rbp)
.L11:
	subl	$1, -156(%rbp)
.L6:
	cmpl	$0, -156(%rbp)
	jg	.L12
	movl	-148(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	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"
	.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
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC0(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%r14, %rdi
	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	$184, %rsp
	.cfi_def_cfa_offset 240
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L2
	leaq	20(%rsp), %rax
	movl	$0, 4(%rsp)
	leaq	32(%rsp), %rbx
	movq	%rax, 8(%rsp)
	leaq	96(%rsp), %r13
	leaq	24(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L4:
	movq	8(%rsp), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	xorl	%r15d, %r15d
	leaq	28(%rsp), %rbp
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %eax
	movl	$0, (%rbx)
	movl	$0, 0(%r13)
	testl	%eax, %eax
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	call	__isoc99_scanf@PLT
	movq	%rbp, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	leal	-1(%rax), %ecx
	movl	$1, %eax
	sall	%cl, %eax
	orl	%eax, (%rbx)
	movl	28(%rsp), %eax
	movl	%ecx, 24(%rsp)
	andl	$1, %eax
	sall	%cl, %eax
	orl	%eax, 0(%r13)
	cmpl	%r15d, 20(%rsp)
	jg	.L3
.L5:
	addl	$1, 4(%rsp)
	movl	16(%rsp), %ecx
	addq	$4, %rbx
	addq	$4, %r13
	movl	4(%rsp), %eax
	cmpl	%eax, %ecx
	jg	.L4
.L2:
	movl	$1, %esi
	xorl	%r12d, %r12d
	sall	%cl, %esi
	subl	$1, %esi
	je	.L6
	movslq	%ecx, %r10
	leaq	32(%rsp), %rbx
	leaq	96(%rsp), %r11
	.p2align 4,,10
	.p2align 3
.L11:
	testl	%ecx, %ecx
	jle	.L15
	xorl	%eax, %eax
	xorl	%edi, %edi
	.p2align 4,,10
	.p2align 3
.L9:
	btl	%eax, %esi
	movl	%eax, %edx
	jnc	.L8
	movl	(%rbx,%rax,4), %r9d
	addl	$1, %edi
	andl	%esi, %r9d
	cmpl	(%r11,%rax,4), %r9d
	jne	.L7
.L8:
	addq	$1, %rax
	addl	$1, %edx
	cmpq	%rax, %r10
	jne	.L9
	cmpl	%r12d, %edi
	movl	%r12d, %eax
	cmovge	%edi, %r12d
	cmpl	%edx, %ecx
	cmovne	%eax, %r12d
.L7:
	subl	$1, %esi
	jne	.L11
	movl	%edi, 24(%rsp)
.L6:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movq	%r14, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$184, %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
.L15:
	.cfi_restore_state
	xorl	%edi, %edi
	jmp	.L7
.L30:
	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"
	.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
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC0(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%r14, %rdi
	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	$184, %rsp
	.cfi_def_cfa_offset 240
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L2
	leaq	20(%rsp), %rax
	movl	$0, 4(%rsp)
	leaq	32(%rsp), %rbx
	movq	%rax, 8(%rsp)
	leaq	96(%rsp), %r13
	leaq	24(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L4:
	movq	8(%rsp), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	xorl	%r15d, %r15d
	leaq	28(%rsp), %rbp
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %eax
	movl	$0, (%rbx)
	movl	$0, 0(%r13)
	testl	%eax, %eax
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	call	__isoc99_scanf@PLT
	movq	%rbp, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	leal	-1(%rax), %ecx
	movl	$1, %eax
	sall	%cl, %eax
	orl	%eax, (%rbx)
	movl	28(%rsp), %eax
	movl	%ecx, 24(%rsp)
	andl	$1, %eax
	sall	%cl, %eax
	orl	%eax, 0(%r13)
	cmpl	%r15d, 20(%rsp)
	jg	.L3
.L5:
	addl	$1, 4(%rsp)
	movl	16(%rsp), %ecx
	addq	$4, %rbx
	addq	$4, %r13
	movl	4(%rsp), %eax
	cmpl	%eax, %ecx
	jg	.L4
.L2:
	movl	$1, %esi
	xorl	%r12d, %r12d
	sall	%cl, %esi
	subl	$1, %esi
	je	.L6
	movslq	%ecx, %r10
	leaq	32(%rsp), %rbx
	leaq	96(%rsp), %r11
	.p2align 4,,10
	.p2align 3
.L11:
	testl	%ecx, %ecx
	jle	.L15
	xorl	%eax, %eax
	xorl	%edi, %edi
	.p2align 4,,10
	.p2align 3
.L9:
	btl	%eax, %esi
	movl	%eax, %edx
	jnc	.L8
	movl	(%rbx,%rax,4), %r9d
	addl	$1, %edi
	andl	%esi, %r9d
	cmpl	(%r11,%rax,4), %r9d
	jne	.L7
.L8:
	addq	$1, %rax
	addl	$1, %edx
	cmpq	%rax, %r10
	jne	.L9
	cmpl	%r12d, %edi
	movl	%r12d, %eax
	cmovge	%edi, %r12d
	cmpl	%edx, %ecx
	cmovne	%eax, %r12d
.L7:
	subl	$1, %esi
	jne	.L11
	movl	%edi, 24(%rsp)
.L6:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movq	%r14, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$184, %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
.L15:
	.cfi_restore_state
	xorl	%edi, %edi
	jmp	.L7
.L30:
	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,a,x,y,s[16],t[16],i,j,m=0;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&a);
    s[i]=0;
    t[i]=0;
    for(j=0;j<a;j++){
      scanf("%d",&x);
      scanf("%d",&y);
      x--;
      s[i]|=1<<x;
      t[i]|=(y&1)<<x;
    }
  }
  for(i=(1<<n)-1;i>0;i--){
    x=0;
    for(j=0;j<n;j++){
      if((i>>j)&1){
        x++;
        if(i&s[j]^t[j]) break;
      }
    }
    if((j==n)&(m<x)) m=x;
  }
  printf("%d",m);
  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,a,x,y,s[16],t[16],i,j,m=0;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&a);
    s[i]=0;
    t[i]=0;
    for(j=0;j<a;j++){
      scanf("%d",&x);
      scanf("%d",&y);
      x--;
      s[i]|=1<<x;
      t[i]|=(y&1)<<x;
    }
  }
  for(i=(1<<n)-1;i>0;i--){
    x=0;
    for(j=0;j<n;j++){
      if((i>>j)&1){
        x++;
        if(i&s[j]^t[j]) break;
      }
    }
    if((j==n)&(m<x)) m=x;
  }
  printf("%d",m);
  return(0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.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	$176, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -148(%rbp)
	leaq	-172(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -156(%rbp)
	jmp	.L2
.L5:
	leaq	-168(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-156(%rbp), %eax
	cltq
	movl	$0, -144(%rbp,%rax,4)
	movl	-156(%rbp), %eax
	cltq
	movl	$0, -80(%rbp,%rax,4)
	movl	$0, -152(%rbp)
	jmp	.L3
.L4:
	leaq	-164(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-160(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-164(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -164(%rbp)
	movl	-156(%rbp), %eax
	cltq
	movl	-144(%rbp,%rax,4), %edx
	movl	-164(%rbp), %eax
	movl	$1, %esi
	movl	%eax, %ecx
	sall	%cl, %esi
	movl	%esi, %eax
	orl	%eax, %edx
	movl	-156(%rbp), %eax
	cltq
	movl	%edx, -144(%rbp,%rax,4)
	movl	-156(%rbp), %eax
	cltq
	movl	-80(%rbp,%rax,4), %esi
	movl	-160(%rbp), %eax
	andl	$1, %eax
	movl	%eax, %edx
	movl	-164(%rbp), %eax
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	orl	%eax, %esi
	movl	%esi, %edx
	movl	-156(%rbp), %eax
	cltq
	movl	%edx, -80(%rbp,%rax,4)
	addl	$1, -152(%rbp)
.L3:
	movl	-168(%rbp), %eax
	cmpl	%eax, -152(%rbp)
	jl	.L4
	addl	$1, -156(%rbp)
.L2:
	movl	-172(%rbp), %eax
	cmpl	%eax, -156(%rbp)
	jl	.L5
	movl	-172(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	subl	$1, %eax
	movl	%eax, -156(%rbp)
	jmp	.L6
.L12:
	movl	$0, -164(%rbp)
	movl	$0, -152(%rbp)
	jmp	.L7
.L10:
	movl	-152(%rbp), %eax
	movl	-156(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L8
	movl	-164(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -164(%rbp)
	movl	-152(%rbp), %eax
	cltq
	movl	-144(%rbp,%rax,4), %eax
	andl	-156(%rbp), %eax
	movl	%eax, %edx
	movl	-152(%rbp), %eax
	cltq
	movl	-80(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L15
.L8:
	addl	$1, -152(%rbp)
.L7:
	movl	-172(%rbp), %eax
	cmpl	%eax, -152(%rbp)
	jl	.L10
	jmp	.L9
.L15:
	nop
.L9:
	movl	-172(%rbp), %eax
	cmpl	%eax, -152(%rbp)
	sete	%dl
	movl	-164(%rbp), %eax
	cmpl	%eax, -148(%rbp)
	setl	%al
	andl	%edx, %eax
	testb	%al, %al
	je	.L11
	movl	-164(%rbp), %eax
	movl	%eax, -148(%rbp)
.L11:
	subl	$1, -156(%rbp)
.L6:
	cmpl	$0, -156(%rbp)
	jg	.L12
	movl	-148(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	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"
	.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	$176, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -148(%rbp)
	leaq	-172(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -156(%rbp)
	jmp	.L2
.L5:
	leaq	-168(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-156(%rbp), %eax
	cltq
	movl	$0, -144(%rbp,%rax,4)
	movl	-156(%rbp), %eax
	cltq
	movl	$0, -80(%rbp,%rax,4)
	movl	$0, -152(%rbp)
	jmp	.L3
.L4:
	leaq	-164(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-160(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-164(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -164(%rbp)
	movl	-156(%rbp), %eax
	cltq
	movl	-144(%rbp,%rax,4), %edx
	movl	-164(%rbp), %eax
	movl	$1, %esi
	movl	%eax, %ecx
	sall	%cl, %esi
	movl	%esi, %eax
	orl	%eax, %edx
	movl	-156(%rbp), %eax
	cltq
	movl	%edx, -144(%rbp,%rax,4)
	movl	-156(%rbp), %eax
	cltq
	movl	-80(%rbp,%rax,4), %esi
	movl	-160(%rbp), %eax
	andl	$1, %eax
	movl	%eax, %edx
	movl	-164(%rbp), %eax
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	orl	%eax, %esi
	movl	%esi, %edx
	movl	-156(%rbp), %eax
	cltq
	movl	%edx, -80(%rbp,%rax,4)
	addl	$1, -152(%rbp)
.L3:
	movl	-168(%rbp), %eax
	cmpl	%eax, -152(%rbp)
	jl	.L4
	addl	$1, -156(%rbp)
.L2:
	movl	-172(%rbp), %eax
	cmpl	%eax, -156(%rbp)
	jl	.L5
	movl	-172(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	subl	$1, %eax
	movl	%eax, -156(%rbp)
	jmp	.L6
.L12:
	movl	$0, -164(%rbp)
	movl	$0, -152(%rbp)
	jmp	.L7
.L10:
	movl	-152(%rbp), %eax
	movl	-156(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L8
	movl	-164(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -164(%rbp)
	movl	-152(%rbp), %eax
	cltq
	movl	-144(%rbp,%rax,4), %eax
	andl	-156(%rbp), %eax
	movl	%eax, %edx
	movl	-152(%rbp), %eax
	cltq
	movl	-80(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L15
.L8:
	addl	$1, -152(%rbp)
.L7:
	movl	-172(%rbp), %eax
	cmpl	%eax, -152(%rbp)
	jl	.L10
	jmp	.L9
.L15:
	nop
.L9:
	movl	-172(%rbp), %eax
	cmpl	%eax, -152(%rbp)
	sete	%dl
	movl	-164(%rbp), %eax
	cmpl	%eax, -148(%rbp)
	setl	%al
	andl	%edx, %eax
	testb	%al, %al
	je	.L11
	movl	-164(%rbp), %eax
	movl	%eax, -148(%rbp)
.L11:
	subl	$1, -156(%rbp)
.L6:
	cmpl	$0, -156(%rbp)
	jg	.L12
	movl	-148(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	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:
