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,m;
  int i,j,rear,a,b,co;
  while(scanf("%d %d",&n,&m),n||m){
    int f[501];
    char c[501]={0};
    char r[501][501]={0};
    rear=0;
    for(i=0;i<m;i++){
      scanf("%d %d",&a,&b);
      if(a==1){
	f[rear++]=b;
	c[b]=1;
      }
      else{
	r[a][b]=1;
	r[b][a]=1;
      }
    }
    co=rear;
    // printf("%d ",co);
    for(i=0;i<rear;i++){
      for(j=2;j<=n;j++){
	if(c[j]==0&&r[f[i]][j]){
	  co++;
	  c[j]=1;
	}
      }
    }
    printf("%d\n",co);
  }
  return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.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
	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
	leaq	-249856(%rsp), %r11
	.cfi_def_cfa 11, 249912
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3720, %rsp
	.cfi_def_cfa_offset 253632
	leaq	.LC0(%rip), %rbx
	movq	%fs:40, %rax
	movq	%rax, 253560(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rax
	leaq	20(%rsp), %r12
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	8(%rsp), %rsi
	xorl	%eax, %eax
	movq	%r12, %rdx
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %r14d
	movl	%r14d, %eax
	orl	16(%rsp), %eax
	je	.L25
	xorl	%eax, %eax
	leaq	253072(%rsp), %rdi
	pxor	%xmm0, %xmm0
	xorl	%esi, %esi
	movl	$60, %ecx
	movl	$251001, %edx
	movaps	%xmm0, 253056(%rsp)
	xorl	%r13d, %r13d
	rep stosq
	movl	$0, (%rdi)
	movb	$0, 4(%rdi)
	leaq	2048(%rsp), %rdi
	call	memset@PLT
	testl	%r14d, %r14d
	jle	.L3
	xorl	%ebp, %ebp
	leaq	28(%rsp), %r15
	leaq	24(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	24(%rsp), %rax
	cmpl	$1, %eax
	je	.L26
	imulq	$501, %rax, %rsi
	movslq	28(%rsp), %rdx
	addl	$1, %ebp
	leaq	253568(%rsi), %rdi
	leaq	(%rsp,%rdi), %rsi
	movb	$1, -251520(%rdx,%rsi)
	imulq	$501, %rdx, %rdx
	leaq	253568(%rdx), %rdi
	leaq	(%rsp,%rdi), %rdx
	movb	$1, -251520(%rax,%rdx)
	cmpl	%ebp, 20(%rsp)
	jg	.L8
	testl	%r13d, %r13d
	je	.L3
.L6:
	movl	16(%rsp), %r10d
	leal	-1(%r13), %eax
	leaq	32(%rsp), %r9
	leaq	36(%rsp,%rax,4), %r11
	leal	1(%r10), %edi
	.p2align 4,,10
	.p2align 3
.L9:
	leaq	253058(%rsp), %rdx
	movl	$2, %eax
	cmpl	$1, %r10d
	jle	.L13
	.p2align 4,,10
	.p2align 3
.L11:
	cmpb	$0, (%rdx)
	jne	.L10
	movslq	(%r9), %rcx
	movslq	%eax, %rsi
	imulq	$501, %rcx, %rcx
	addq	$253568, %rcx
	addq	%rsp, %rcx
	cmpb	$0, -251520(%rsi,%rcx)
	je	.L10
	movb	$1, (%rdx)
	addl	$1, %r13d
.L10:
	addl	$1, %eax
	addq	$1, %rdx
	cmpl	%eax, %edi
	jne	.L11
.L13:
	addq	$4, %r9
	cmpq	%r11, %r9
	jne	.L9
.L3:
	movl	%r13d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L26:
	movslq	28(%rsp), %rax
	movslq	%r13d, %r8
	leal	1(%r13), %edx
	addl	$1, %ebp
	movl	%edx, %r13d
	movl	%eax, 32(%rsp,%r8,4)
	movb	$1, 253056(%rsp,%rax)
	cmpl	20(%rsp), %ebp
	jl	.L8
	jmp	.L6
.L25:
	movq	253560(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$253576, %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
.L27:
	.cfi_restore_state
	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 %d"
.LC1:
	.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
	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
	leaq	-249856(%rsp), %r11
	.cfi_def_cfa 11, 249912
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3720, %rsp
	.cfi_def_cfa_offset 253632
	leaq	.LC0(%rip), %rbx
	movq	%fs:40, %rax
	movq	%rax, 253560(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rax
	leaq	20(%rsp), %r12
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	8(%rsp), %rsi
	xorl	%eax, %eax
	movq	%r12, %rdx
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %r14d
	movl	%r14d, %eax
	orl	16(%rsp), %eax
	je	.L25
	xorl	%eax, %eax
	leaq	253072(%rsp), %rdi
	pxor	%xmm0, %xmm0
	xorl	%esi, %esi
	movl	$60, %ecx
	movl	$251001, %edx
	movaps	%xmm0, 253056(%rsp)
	xorl	%r13d, %r13d
	rep stosq
	movl	$0, (%rdi)
	movb	$0, 4(%rdi)
	leaq	2048(%rsp), %rdi
	call	memset@PLT
	testl	%r14d, %r14d
	jle	.L3
	xorl	%ebp, %ebp
	leaq	28(%rsp), %r15
	leaq	24(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	24(%rsp), %rax
	cmpl	$1, %eax
	je	.L26
	imulq	$501, %rax, %rsi
	movslq	28(%rsp), %rdx
	addl	$1, %ebp
	leaq	253568(%rsi), %rdi
	leaq	(%rsp,%rdi), %rsi
	movb	$1, -251520(%rdx,%rsi)
	imulq	$501, %rdx, %rdx
	leaq	253568(%rdx), %rdi
	leaq	(%rsp,%rdi), %rdx
	movb	$1, -251520(%rax,%rdx)
	cmpl	%ebp, 20(%rsp)
	jg	.L8
	testl	%r13d, %r13d
	je	.L3
.L6:
	movl	16(%rsp), %r10d
	leal	-1(%r13), %eax
	leaq	32(%rsp), %r9
	leaq	36(%rsp,%rax,4), %r11
	leal	1(%r10), %edi
	.p2align 4,,10
	.p2align 3
.L9:
	leaq	253058(%rsp), %rdx
	movl	$2, %eax
	cmpl	$1, %r10d
	jle	.L13
	.p2align 4,,10
	.p2align 3
.L11:
	cmpb	$0, (%rdx)
	jne	.L10
	movslq	(%r9), %rcx
	movslq	%eax, %rsi
	imulq	$501, %rcx, %rcx
	addq	$253568, %rcx
	addq	%rsp, %rcx
	cmpb	$0, -251520(%rsi,%rcx)
	je	.L10
	movb	$1, (%rdx)
	addl	$1, %r13d
.L10:
	addl	$1, %eax
	addq	$1, %rdx
	cmpl	%eax, %edi
	jne	.L11
.L13:
	addq	$4, %r9
	cmpq	%r11, %r9
	jne	.L9
.L3:
	movl	%r13d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L26:
	movslq	28(%rsp), %rax
	movslq	%r13d, %r8
	leal	1(%r13), %edx
	addl	$1, %ebp
	movl	%edx, %r13d
	movl	%eax, 32(%rsp,%r8,4)
	movb	$1, 253056(%rsp,%rax)
	cmpl	20(%rsp), %ebp
	jl	.L8
	jmp	.L6
.L25:
	movq	253560(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$253576, %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
.L27:
	.cfi_restore_state
	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 %d"
.LC1:
	.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
	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
	leaq	-249856(%rsp), %r11
	.cfi_def_cfa 11, 249912
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3720, %rsp
	.cfi_def_cfa_offset 253632
	leaq	.LC0(%rip), %rbx
	movq	%fs:40, %rax
	movq	%rax, 253560(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rax
	leaq	20(%rsp), %r12
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	8(%rsp), %rsi
	xorl	%eax, %eax
	movq	%r12, %rdx
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %r14d
	movl	%r14d, %eax
	orl	16(%rsp), %eax
	je	.L25
	xorl	%eax, %eax
	leaq	253072(%rsp), %rdi
	pxor	%xmm0, %xmm0
	xorl	%esi, %esi
	movl	$60, %ecx
	movl	$251001, %edx
	movaps	%xmm0, 253056(%rsp)
	xorl	%r13d, %r13d
	rep stosq
	movl	$0, (%rdi)
	movb	$0, 4(%rdi)
	leaq	2048(%rsp), %rdi
	call	memset@PLT
	testl	%r14d, %r14d
	jle	.L3
	xorl	%ebp, %ebp
	leaq	28(%rsp), %r15
	leaq	24(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	24(%rsp), %rax
	cmpl	$1, %eax
	je	.L26
	imulq	$501, %rax, %rsi
	movslq	28(%rsp), %rdx
	addl	$1, %ebp
	leaq	253568(%rsi), %rdi
	leaq	(%rsp,%rdi), %rsi
	movb	$1, -251520(%rdx,%rsi)
	imulq	$501, %rdx, %rdx
	leaq	253568(%rdx), %rdi
	leaq	(%rsp,%rdi), %rdx
	movb	$1, -251520(%rax,%rdx)
	cmpl	%ebp, 20(%rsp)
	jg	.L8
	testl	%r13d, %r13d
	je	.L3
.L6:
	movl	16(%rsp), %r10d
	leal	-1(%r13), %eax
	leaq	32(%rsp), %r9
	leaq	36(%rsp,%rax,4), %r11
	leal	1(%r10), %edi
	.p2align 4,,10
	.p2align 3
.L9:
	leaq	253058(%rsp), %rdx
	movl	$2, %eax
	cmpl	$1, %r10d
	jle	.L13
	.p2align 4,,10
	.p2align 3
.L11:
	cmpb	$0, (%rdx)
	jne	.L10
	movslq	(%r9), %rcx
	movslq	%eax, %rsi
	imulq	$501, %rcx, %rcx
	addq	$253568, %rcx
	addq	%rsp, %rcx
	cmpb	$0, -251520(%rsi,%rcx)
	je	.L10
	movb	$1, (%rdx)
	addl	$1, %r13d
.L10:
	addl	$1, %eax
	addq	$1, %rdx
	cmpl	%eax, %edi
	jne	.L11
.L13:
	addq	$4, %r9
	cmpq	%r11, %r9
	jne	.L9
.L3:
	movl	%r13d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L26:
	movslq	28(%rsp), %rax
	movslq	%r13d, %r8
	leal	1(%r13), %edx
	addl	$1, %ebp
	movl	%edx, %r13d
	movl	%eax, 32(%rsp,%r8,4)
	movb	$1, 253056(%rsp,%rax)
	cmpl	20(%rsp), %ebp
	jl	.L8
	jmp	.L6
.L25:
	movq	253560(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$253576, %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
.L27:
	.cfi_restore_state
	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,m;
  int i,j,rear,a,b,co;
  while(scanf("%d %d",&n,&m),n||m){
    int f[501];
    char c[501]={0};
    char r[501][501]={0};
    rear=0;
    for(i=0;i<m;i++){
      scanf("%d %d",&a,&b);
      if(a==1){
	f[rear++]=b;
	c[b]=1;
      }
      else{
	r[a][b]=1;
	r[b][a]=1;
      }
    }
    co=rear;
    // printf("%d ",co);
    for(i=0;i<rear;i++){
      for(j=2;j<=n;j++){
	if(c[j]==0&&r[f[i]][j]){
	  co++;
	  c[j]=1;
	}
      }
    }
    printf("%d\n",co);
  }
  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,m;
  int i,j,rear,a,b,co;
  while(scanf("%d %d",&n,&m),n||m){
    int f[501];
    char c[501]={0};
    char r[501][501]={0};
    rear=0;
    for(i=0;i<m;i++){
      scanf("%d %d",&a,&b);
      if(a==1){
	f[rear++]=b;
	c[b]=1;
      }
      else{
	r[a][b]=1;
	r[b][a]=1;
      }
    }
    co=rear;
    // printf("%d ",co);
    for(i=0;i<rear;i++){
      for(j=2;j<=n;j++){
	if(c[j]==0&&r[f[i]][j]){
	  co++;
	  c[j]=1;
	}
      }
    }
    printf("%d\n",co);
  }
  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:

6
5
1 2
1 3
3 4
2 3
4 5
6
5
2 3
3 4
4 5
5 6
2 6
0
0
 6
5
1 2
1 3
3 4
2 3
4 5
6
5
2 3
3 4
1 5
5 6
2 6
0
0
 6
5
1 2
1 3
3 5
2 3
4 5
6
5
2 3
3 4
1 5
6 6
2 6
0
0
 6
5
1 2
1 3
3 5
2 3
4 5
6
5
2 3
3 4
1 5
1 6
2 6
0
0
 6
5
1 2
1 3
2 4
2 3
3 5
6
5
2 3
4 4
4 5
5 6
2 5
0
0
 6
5
1 2
1 4
3 4
2 3
4 5
6
5
2 3
3 4
4 3
5 6
1 6
0
0
 6
5
1 2
1 3
3 2
3 3
4 5
6
5
2 3
3 4
4 4
5 6
1 6
0
0
 6
5
1 2
1 3
3 2
3 3
4 5
6
5
2 3
3 4
4 4
5 5
1 6
0
0
 6
5
1 4
1 3
3 2
3 3
3 5
6
5
2 3
3 4
4 3
5 5
1 6
0
0
 6
5
1 2
1 3
3 5
3 4
4 5
6
5
2 3
3 4
1 5
1 6
2 6
0
0

3
0
 3
2
 3
1
 3
3
 4
0
 4
2
 2
2
 2
1
 4
1
 4
3

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,m;
  int i,j,rear,a,b,co;
  while(scanf("%d %d",&n,&m),n||m){
    int f[501];
    char c[501]={0};
    char r[501][501]={0};
    rear=0;
    for(i=0;i<m;i++){
      scanf("%d %d",&a,&b);
      if(a==1){
	f[rear++]=b;
	c[b]=1;
      }
      else{
	r[a][b]=1;
	r[b][a]=1;
      }
    }
    co=rear;
    // printf("%d ",co);
    for(i=0;i<rear;i++){
      for(j=2;j<=n;j++){
	if(c[j]==0&&r[f[i]][j]){
	  co++;
	  c[j]=1;
	}
      }
    }
    printf("%d\n",co);
  }
  return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.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
	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
	leaq	-249856(%rsp), %r11
	.cfi_def_cfa 11, 249912
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3720, %rsp
	.cfi_def_cfa_offset 253632
	leaq	.LC0(%rip), %rbx
	movq	%fs:40, %rax
	movq	%rax, 253560(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rax
	leaq	20(%rsp), %r12
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	8(%rsp), %rsi
	xorl	%eax, %eax
	movq	%r12, %rdx
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %r14d
	movl	%r14d, %eax
	orl	16(%rsp), %eax
	je	.L25
	xorl	%eax, %eax
	leaq	253072(%rsp), %rdi
	pxor	%xmm0, %xmm0
	xorl	%esi, %esi
	movl	$60, %ecx
	movl	$251001, %edx
	movaps	%xmm0, 253056(%rsp)
	xorl	%r13d, %r13d
	rep stosq
	movl	$0, (%rdi)
	movb	$0, 4(%rdi)
	leaq	2048(%rsp), %rdi
	call	memset@PLT
	testl	%r14d, %r14d
	jle	.L3
	xorl	%ebp, %ebp
	leaq	28(%rsp), %r15
	leaq	24(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	24(%rsp), %rax
	cmpl	$1, %eax
	je	.L26
	imulq	$501, %rax, %rsi
	movslq	28(%rsp), %rdx
	addl	$1, %ebp
	leaq	253568(%rsi), %rdi
	leaq	(%rsp,%rdi), %rsi
	movb	$1, -251520(%rdx,%rsi)
	imulq	$501, %rdx, %rdx
	leaq	253568(%rdx), %rdi
	leaq	(%rsp,%rdi), %rdx
	movb	$1, -251520(%rax,%rdx)
	cmpl	%ebp, 20(%rsp)
	jg	.L8
	testl	%r13d, %r13d
	je	.L3
.L6:
	movl	16(%rsp), %r10d
	leal	-1(%r13), %eax
	leaq	32(%rsp), %r9
	leaq	36(%rsp,%rax,4), %r11
	leal	1(%r10), %edi
	.p2align 4,,10
	.p2align 3
.L9:
	leaq	253058(%rsp), %rdx
	movl	$2, %eax
	cmpl	$1, %r10d
	jle	.L13
	.p2align 4,,10
	.p2align 3
.L11:
	cmpb	$0, (%rdx)
	jne	.L10
	movslq	(%r9), %rcx
	movslq	%eax, %rsi
	imulq	$501, %rcx, %rcx
	addq	$253568, %rcx
	addq	%rsp, %rcx
	cmpb	$0, -251520(%rsi,%rcx)
	je	.L10
	movb	$1, (%rdx)
	addl	$1, %r13d
.L10:
	addl	$1, %eax
	addq	$1, %rdx
	cmpl	%eax, %edi
	jne	.L11
.L13:
	addq	$4, %r9
	cmpq	%r11, %r9
	jne	.L9
.L3:
	movl	%r13d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L26:
	movslq	28(%rsp), %rax
	movslq	%r13d, %r8
	leal	1(%r13), %edx
	addl	$1, %ebp
	movl	%edx, %r13d
	movl	%eax, 32(%rsp,%r8,4)
	movb	$1, 253056(%rsp,%rax)
	cmpl	20(%rsp), %ebp
	jl	.L8
	jmp	.L6
.L25:
	movq	253560(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$253576, %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
.L27:
	.cfi_restore_state
	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 %d"
.LC1:
	.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
	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
	leaq	-249856(%rsp), %r11
	.cfi_def_cfa 11, 249912
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3720, %rsp
	.cfi_def_cfa_offset 253632
	leaq	.LC0(%rip), %rbx
	movq	%fs:40, %rax
	movq	%rax, 253560(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rax
	leaq	20(%rsp), %r12
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	8(%rsp), %rsi
	xorl	%eax, %eax
	movq	%r12, %rdx
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %r14d
	movl	%r14d, %eax
	orl	16(%rsp), %eax
	je	.L25
	xorl	%eax, %eax
	leaq	253072(%rsp), %rdi
	pxor	%xmm0, %xmm0
	xorl	%esi, %esi
	movl	$60, %ecx
	movl	$251001, %edx
	movaps	%xmm0, 253056(%rsp)
	xorl	%r13d, %r13d
	rep stosq
	movl	$0, (%rdi)
	movb	$0, 4(%rdi)
	leaq	2048(%rsp), %rdi
	call	memset@PLT
	testl	%r14d, %r14d
	jle	.L3
	xorl	%ebp, %ebp
	leaq	28(%rsp), %r15
	leaq	24(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	24(%rsp), %rax
	cmpl	$1, %eax
	je	.L26
	imulq	$501, %rax, %rsi
	movslq	28(%rsp), %rdx
	addl	$1, %ebp
	leaq	253568(%rsi), %rdi
	leaq	(%rsp,%rdi), %rsi
	movb	$1, -251520(%rdx,%rsi)
	imulq	$501, %rdx, %rdx
	leaq	253568(%rdx), %rdi
	leaq	(%rsp,%rdi), %rdx
	movb	$1, -251520(%rax,%rdx)
	cmpl	%ebp, 20(%rsp)
	jg	.L8
	testl	%r13d, %r13d
	je	.L3
.L6:
	movl	16(%rsp), %r10d
	leal	-1(%r13), %eax
	leaq	32(%rsp), %r9
	leaq	36(%rsp,%rax,4), %r11
	leal	1(%r10), %edi
	.p2align 4,,10
	.p2align 3
.L9:
	leaq	253058(%rsp), %rdx
	movl	$2, %eax
	cmpl	$1, %r10d
	jle	.L13
	.p2align 4,,10
	.p2align 3
.L11:
	cmpb	$0, (%rdx)
	jne	.L10
	movslq	(%r9), %rcx
	movslq	%eax, %rsi
	imulq	$501, %rcx, %rcx
	addq	$253568, %rcx
	addq	%rsp, %rcx
	cmpb	$0, -251520(%rsi,%rcx)
	je	.L10
	movb	$1, (%rdx)
	addl	$1, %r13d
.L10:
	addl	$1, %eax
	addq	$1, %rdx
	cmpl	%eax, %edi
	jne	.L11
.L13:
	addq	$4, %r9
	cmpq	%r11, %r9
	jne	.L9
.L3:
	movl	%r13d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L26:
	movslq	28(%rsp), %rax
	movslq	%r13d, %r8
	leal	1(%r13), %edx
	addl	$1, %ebp
	movl	%edx, %r13d
	movl	%eax, 32(%rsp,%r8,4)
	movb	$1, 253056(%rsp,%rax)
	cmpl	20(%rsp), %ebp
	jl	.L8
	jmp	.L6
.L25:
	movq	253560(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$253576, %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
.L27:
	.cfi_restore_state
	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:
```