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

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.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
	leaq	-249856(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3712, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L15:
	movq	$0, -512(%rbp)
	movq	$0, -504(%rbp)
	leaq	-496(%rbp), %rdx
	movl	$0, %eax
	movl	$60, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	movb	%al, (%rdx)
	addq	$1, %rdx
	leaq	-251520(%rbp), %rax
	movl	$251001, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -253544(%rbp)
	movl	$0, -253552(%rbp)
	jmp	.L3
.L6:
	leaq	-253556(%rbp), %rdx
	leaq	-253560(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-253560(%rbp), %eax
	cmpl	$1, %eax
	jne	.L4
	movl	-253544(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -253544(%rbp)
	movl	-253556(%rbp), %edx
	cltq
	movl	%edx, -253536(%rbp,%rax,4)
	movl	-253556(%rbp), %eax
	cltq
	movb	$1, -512(%rbp,%rax)
	jmp	.L5
.L4:
	movl	-253560(%rbp), %eax
	movl	-253556(%rbp), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$501, %rax, %rax
	addq	%rbp, %rax
	addq	%rdx, %rax
	subq	$251520, %rax
	movb	$1, (%rax)
	movl	-253556(%rbp), %eax
	movl	-253560(%rbp), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$501, %rax, %rax
	addq	%rbp, %rax
	addq	%rdx, %rax
	subq	$251520, %rax
	movb	$1, (%rax)
.L5:
	addl	$1, -253552(%rbp)
.L3:
	movl	-253564(%rbp), %eax
	cmpl	%eax, -253552(%rbp)
	jl	.L6
	movl	-253544(%rbp), %eax
	movl	%eax, -253540(%rbp)
	movl	$0, -253552(%rbp)
	jmp	.L7
.L11:
	movl	$2, -253548(%rbp)
	jmp	.L8
.L10:
	movl	-253548(%rbp), %eax
	cltq
	movzbl	-512(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L9
	movl	-253552(%rbp), %eax
	cltq
	movl	-253536(%rbp,%rax,4), %eax
	movl	-253548(%rbp), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$501, %rax, %rax
	addq	%rbp, %rax
	addq	%rdx, %rax
	subq	$251520, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	je	.L9
	addl	$1, -253540(%rbp)
	movl	-253548(%rbp), %eax
	cltq
	movb	$1, -512(%rbp,%rax)
.L9:
	addl	$1, -253548(%rbp)
.L8:
	movl	-253568(%rbp), %eax
	cmpl	%eax, -253548(%rbp)
	jle	.L10
	addl	$1, -253552(%rbp)
.L7:
	movl	-253552(%rbp), %eax
	cmpl	-253544(%rbp), %eax
	jl	.L11
	movl	-253540(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-253564(%rbp), %rdx
	leaq	-253568(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-253568(%rbp), %eax
	testl	%eax, %eax
	jne	.L12
	movl	-253564(%rbp), %eax
	testl	%eax, %eax
	je	.L13
.L12:
	movl	$1, %eax
	jmp	.L14
.L13:
	movl	$0, %eax
.L14:
	testl	%eax, %eax
	jne	.L15
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %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
	.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:

#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;
}
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 unoptimized 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;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.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
	leaq	-249856(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3712, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L15:
	movq	$0, -512(%rbp)
	movq	$0, -504(%rbp)
	leaq	-496(%rbp), %rdx
	movl	$0, %eax
	movl	$60, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	movb	%al, (%rdx)
	addq	$1, %rdx
	leaq	-251520(%rbp), %rax
	movl	$251001, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -253544(%rbp)
	movl	$0, -253552(%rbp)
	jmp	.L3
.L6:
	leaq	-253556(%rbp), %rdx
	leaq	-253560(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-253560(%rbp), %eax
	cmpl	$1, %eax
	jne	.L4
	movl	-253544(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -253544(%rbp)
	movl	-253556(%rbp), %edx
	cltq
	movl	%edx, -253536(%rbp,%rax,4)
	movl	-253556(%rbp), %eax
	cltq
	movb	$1, -512(%rbp,%rax)
	jmp	.L5
.L4:
	movl	-253560(%rbp), %eax
	movl	-253556(%rbp), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$501, %rax, %rax
	addq	%rbp, %rax
	addq	%rdx, %rax
	subq	$251520, %rax
	movb	$1, (%rax)
	movl	-253556(%rbp), %eax
	movl	-253560(%rbp), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$501, %rax, %rax
	addq	%rbp, %rax
	addq	%rdx, %rax
	subq	$251520, %rax
	movb	$1, (%rax)
.L5:
	addl	$1, -253552(%rbp)
.L3:
	movl	-253564(%rbp), %eax
	cmpl	%eax, -253552(%rbp)
	jl	.L6
	movl	-253544(%rbp), %eax
	movl	%eax, -253540(%rbp)
	movl	$0, -253552(%rbp)
	jmp	.L7
.L11:
	movl	$2, -253548(%rbp)
	jmp	.L8
.L10:
	movl	-253548(%rbp), %eax
	cltq
	movzbl	-512(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L9
	movl	-253552(%rbp), %eax
	cltq
	movl	-253536(%rbp,%rax,4), %eax
	movl	-253548(%rbp), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$501, %rax, %rax
	addq	%rbp, %rax
	addq	%rdx, %rax
	subq	$251520, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	je	.L9
	addl	$1, -253540(%rbp)
	movl	-253548(%rbp), %eax
	cltq
	movb	$1, -512(%rbp,%rax)
.L9:
	addl	$1, -253548(%rbp)
.L8:
	movl	-253568(%rbp), %eax
	cmpl	%eax, -253548(%rbp)
	jle	.L10
	addl	$1, -253552(%rbp)
.L7:
	movl	-253552(%rbp), %eax
	cmpl	-253544(%rbp), %eax
	jl	.L11
	movl	-253540(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-253564(%rbp), %rdx
	leaq	-253568(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-253568(%rbp), %eax
	testl	%eax, %eax
	jne	.L12
	movl	-253564(%rbp), %eax
	testl	%eax, %eax
	je	.L13
.L12:
	movl	$1, %eax
	jmp	.L14
.L13:
	movl	$0, %eax
.L14:
	testl	%eax, %eax
	jne	.L15
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.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
	leaq	-249856(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3712, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L15:
	movq	$0, -512(%rbp)
	movq	$0, -504(%rbp)
	leaq	-496(%rbp), %rdx
	movl	$0, %eax
	movl	$60, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	movb	%al, (%rdx)
	addq	$1, %rdx
	leaq	-251520(%rbp), %rax
	movl	$251001, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -253544(%rbp)
	movl	$0, -253552(%rbp)
	jmp	.L3
.L6:
	leaq	-253556(%rbp), %rdx
	leaq	-253560(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-253560(%rbp), %eax
	cmpl	$1, %eax
	jne	.L4
	movl	-253544(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -253544(%rbp)
	movl	-253556(%rbp), %edx
	cltq
	movl	%edx, -253536(%rbp,%rax,4)
	movl	-253556(%rbp), %eax
	cltq
	movb	$1, -512(%rbp,%rax)
	jmp	.L5
.L4:
	movl	-253560(%rbp), %eax
	movl	-253556(%rbp), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$501, %rax, %rax
	addq	%rbp, %rax
	addq	%rdx, %rax
	subq	$251520, %rax
	movb	$1, (%rax)
	movl	-253556(%rbp), %eax
	movl	-253560(%rbp), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$501, %rax, %rax
	addq	%rbp, %rax
	addq	%rdx, %rax
	subq	$251520, %rax
	movb	$1, (%rax)
.L5:
	addl	$1, -253552(%rbp)
.L3:
	movl	-253564(%rbp), %eax
	cmpl	%eax, -253552(%rbp)
	jl	.L6
	movl	-253544(%rbp), %eax
	movl	%eax, -253540(%rbp)
	movl	$0, -253552(%rbp)
	jmp	.L7
.L11:
	movl	$2, -253548(%rbp)
	jmp	.L8
.L10:
	movl	-253548(%rbp), %eax
	cltq
	movzbl	-512(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L9
	movl	-253552(%rbp), %eax
	cltq
	movl	-253536(%rbp,%rax,4), %eax
	movl	-253548(%rbp), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$501, %rax, %rax
	addq	%rbp, %rax
	addq	%rdx, %rax
	subq	$251520, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	je	.L9
	addl	$1, -253540(%rbp)
	movl	-253548(%rbp), %eax
	cltq
	movb	$1, -512(%rbp,%rax)
.L9:
	addl	$1, -253548(%rbp)
.L8:
	movl	-253568(%rbp), %eax
	cmpl	%eax, -253548(%rbp)
	jle	.L10
	addl	$1, -253552(%rbp)
.L7:
	movl	-253552(%rbp), %eax
	cmpl	-253544(%rbp), %eax
	jl	.L11
	movl	-253540(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-253564(%rbp), %rdx
	leaq	-253568(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-253568(%rbp), %eax
	testl	%eax, %eax
	jne	.L12
	movl	-253564(%rbp), %eax
	testl	%eax, %eax
	je	.L13
.L12:
	movl	$1, %eax
	jmp	.L14
.L13:
	movl	$0, %eax
.L14:
	testl	%eax, %eax
	jne	.L15
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
