Given the following C code and 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);
}```

Assembly Code:

```assembly
	.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:
```

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.
Optimized Assembly Code:

user
```assembly
	.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
```assembly
	.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:
```
```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);
}```
Given the following C 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);
}```

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.
Optimized Assembly Code:

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 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);
}```

Assembly Code:

```assembly
	.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:
```

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.
Optimized Assembly Code:

train
```assembly
	.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:
```