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 ;
	while( 1 )
	{
		int ans =  0 ;

		int I[ 500 + 1 ] = { 0 } ;
		char friends[ 500 + 1 ][ 500 + 1 ] = { 0 } ;

		scanf( "%d %d" ,&N ,&M ) ;

		if( N | M )
		{
			int i ,j ;
			for( i = 0 ; i < M ; ++i )
			{
				int a ,b ;
				scanf( "%d %d" ,&a ,&b ) ;

				friends[ a ][ b ] = friends[ b ][ a ] = 1 ;
			}

			for( i = 2 ; i <= N ; ++i )
			{
				if( friends[ 1 ][ i ] == 1 )
				{
					++I[ i ] ;

					ans += I[ i ] < 2 ? I[ i ] : 0 ;

					for( j = 2 ; j <= N ; ++j )
					{
						if( friends[ i ][ j ] == 1 )
						{
							++I[ j ] ;

							ans += I[ j ] < 2 ? I[ j ] : 0 ;
						}
					}
				}
			}

			printf( "%d\n" ,ans ) ;
		}

		else
		{
			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	$3216, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L15:
	movl	$0, -253052(%rbp)
	leaq	-253040(%rbp), %rdx
	movl	$0, %eax
	movl	$250, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	leaq	-251024(%rbp), %rax
	movl	$251001, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	leaq	-253064(%rbp), %rdx
	leaq	-253068(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-253068(%rbp), %edx
	movl	-253064(%rbp), %eax
	orl	%edx, %eax
	testl	%eax, %eax
	je	.L2
	movl	$0, -253048(%rbp)
	jmp	.L3
.L4:
	leaq	-253056(%rbp), %rdx
	leaq	-253060(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-253056(%rbp), %eax
	movl	-253060(%rbp), %edx
	movslq	%edx, %rsi
	movslq	%eax, %rcx
	imulq	$501, %rcx, %rcx
	addq	%rbp, %rcx
	addq	%rsi, %rcx
	subq	$251024, %rcx
	movb	$1, (%rcx)
	movl	-253060(%rbp), %ecx
	movl	-253056(%rbp), %esi
	movslq	%edx, %rdx
	cltq
	imulq	$501, %rax, %rax
	addq	%rbp, %rax
	addq	%rdx, %rax
	subq	$251024, %rax
	movzbl	(%rax), %eax
	movslq	%esi, %rsi
	movslq	%ecx, %rdx
	imulq	$501, %rdx, %rdx
	addq	%rbp, %rdx
	addq	%rsi, %rdx
	subq	$251024, %rdx
	movb	%al, (%rdx)
	addl	$1, -253048(%rbp)
.L3:
	movl	-253064(%rbp), %eax
	cmpl	%eax, -253048(%rbp)
	jl	.L4
	movl	$2, -253048(%rbp)
	jmp	.L5
.L14:
	movl	-253048(%rbp), %eax
	cltq
	movzbl	-250523(%rbp,%rax), %eax
	cmpb	$1, %al
	jne	.L6
	movl	-253048(%rbp), %eax
	cltq
	movl	-253040(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-253048(%rbp), %eax
	cltq
	movl	%edx, -253040(%rbp,%rax,4)
	movl	-253048(%rbp), %eax
	cltq
	movl	-253040(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jg	.L7
	movl	-253048(%rbp), %eax
	cltq
	movl	-253040(%rbp,%rax,4), %eax
	jmp	.L8
.L7:
	movl	$0, %eax
.L8:
	addl	%eax, -253052(%rbp)
	movl	$2, -253044(%rbp)
	jmp	.L9
.L13:
	movl	-253044(%rbp), %eax
	movslq	%eax, %rdx
	movl	-253048(%rbp), %eax
	cltq
	imulq	$501, %rax, %rax
	addq	%rbp, %rax
	addq	%rdx, %rax
	subq	$251024, %rax
	movzbl	(%rax), %eax
	cmpb	$1, %al
	jne	.L10
	movl	-253044(%rbp), %eax
	cltq
	movl	-253040(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-253044(%rbp), %eax
	cltq
	movl	%edx, -253040(%rbp,%rax,4)
	movl	-253044(%rbp), %eax
	cltq
	movl	-253040(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jg	.L11
	movl	-253044(%rbp), %eax
	cltq
	movl	-253040(%rbp,%rax,4), %eax
	jmp	.L12
.L11:
	movl	$0, %eax
.L12:
	addl	%eax, -253052(%rbp)
.L10:
	addl	$1, -253044(%rbp)
.L9:
	movl	-253068(%rbp), %eax
	cmpl	%eax, -253044(%rbp)
	jle	.L13
.L6:
	addl	$1, -253048(%rbp)
.L5:
	movl	-253068(%rbp), %eax
	cmpl	%eax, -253048(%rbp)
	jle	.L14
	movl	-253052(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L15
.L2:
	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	$3224, %rsp
	.cfi_def_cfa_offset 253136
	leaq	.LC0(%rip), %rbx
	movq	%fs:40, %rax
	movq	%rax, 253064(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rax
	leaq	2048(%rsp), %r13
	movq	%rax, 8(%rsp)
	leaq	16(%rsp), %rax
	leaq	20(%rsp), %r12
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L12:
	movq	8(%rsp), %rdi
	xorl	%eax, %eax
	movl	$250, %ecx
	xorl	%esi, %esi
	movl	$251001, %edx
	rep stosq
	movl	$0, (%rdi)
	movq	%r13, %rdi
	call	memset@PLT
	movq	(%rsp), %rsi
	movq	%r12, %rdx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %eax
	movl	20(%rsp), %edx
	movl	%eax, %edi
	orl	%edx, %edi
	je	.L2
	testl	%edx, %edx
	jle	.L3
	xorl	%ebp, %ebp
	leaq	28(%rsp), %r15
	leaq	24(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r15, %rdx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	28(%rsp), %rcx
	movslq	24(%rsp), %rax
	addl	$1, %ebp
	imulq	$501, %rcx, %rdx
	leaq	253072(%rdx), %rdi
	leaq	(%rsp,%rdi), %rdx
	movb	$1, -251024(%rax,%rdx)
	imulq	$501, %rax, %rax
	addq	$253072, %rax
	addq	%rsp, %rax
	movb	$1, -251024(%rcx,%rax)
	cmpl	%ebp, 20(%rsp)
	jg	.L4
	movl	16(%rsp), %eax
.L3:
	cmpl	$1, %eax
	jle	.L14
	subl	$2, %eax
	leaq	40(%rsp), %r15
	xorl	%r9d, %r9d
	leaq	2551(%rsp), %rdx
	leaq	3052(%rsp), %r8
	movq	%r15, %rdi
	leaq	2552(%rsp,%rax), %r11
	leaq	44(%rsp,%rax,4), %r10
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L6:
	addq	$1, %rdx
	addq	$501, %r8
	addq	$4, %rdi
	cmpq	%r11, %rdx
	je	.L5
.L11:
	cmpb	$1, (%rdx)
	jne	.L6
	movl	(%rdi), %eax
	addl	$1, %eax
	leal	(%r9,%rax), %ecx
	cmpl	$2, %eax
	movl	%eax, (%rdi)
	movq	%r15, %rax
	cmovl	%ecx, %r9d
	movq	%r8, %rcx
	.p2align 4,,10
	.p2align 3
.L10:
	cmpb	$1, (%rcx)
	jne	.L8
	movl	(%rax), %esi
	addl	$1, %esi
	leal	(%r9,%rsi), %ebp
	cmpl	$2, %esi
	movl	%esi, (%rax)
	cmovl	%ebp, %r9d
.L8:
	addq	$4, %rax
	addq	$1, %rcx
	cmpq	%r10, %rax
	jne	.L10
	jmp	.L6
.L14:
	xorl	%r9d, %r9d
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%r9d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L2:
	movq	253064(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$253080, %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
.L20:
	.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	$3224, %rsp
	.cfi_def_cfa_offset 253136
	leaq	.LC0(%rip), %rbx
	movq	%fs:40, %rax
	movq	%rax, 253064(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rax
	leaq	2048(%rsp), %r13
	movq	%rax, 8(%rsp)
	leaq	16(%rsp), %rax
	leaq	20(%rsp), %r12
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L12:
	movq	8(%rsp), %rdi
	xorl	%eax, %eax
	movl	$250, %ecx
	xorl	%esi, %esi
	movl	$251001, %edx
	rep stosq
	movl	$0, (%rdi)
	movq	%r13, %rdi
	call	memset@PLT
	movq	(%rsp), %rsi
	movq	%r12, %rdx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %eax
	movl	20(%rsp), %edx
	movl	%eax, %edi
	orl	%edx, %edi
	je	.L2
	testl	%edx, %edx
	jle	.L3
	xorl	%ebp, %ebp
	leaq	28(%rsp), %r15
	leaq	24(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r15, %rdx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	28(%rsp), %rcx
	movslq	24(%rsp), %rax
	addl	$1, %ebp
	imulq	$501, %rcx, %rdx
	leaq	253072(%rdx), %rdi
	leaq	(%rsp,%rdi), %rdx
	movb	$1, -251024(%rax,%rdx)
	imulq	$501, %rax, %rax
	addq	$253072, %rax
	addq	%rsp, %rax
	movb	$1, -251024(%rcx,%rax)
	cmpl	%ebp, 20(%rsp)
	jg	.L4
	movl	16(%rsp), %eax
.L3:
	cmpl	$1, %eax
	jle	.L14
	subl	$2, %eax
	leaq	40(%rsp), %r15
	xorl	%r9d, %r9d
	leaq	2551(%rsp), %rdx
	leaq	3052(%rsp), %r8
	movq	%r15, %rdi
	leaq	2552(%rsp,%rax), %r11
	leaq	44(%rsp,%rax,4), %r10
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L6:
	addq	$1, %rdx
	addq	$501, %r8
	addq	$4, %rdi
	cmpq	%r11, %rdx
	je	.L5
.L11:
	cmpb	$1, (%rdx)
	jne	.L6
	movl	(%rdi), %eax
	addl	$1, %eax
	leal	(%r9,%rax), %ecx
	cmpl	$2, %eax
	movl	%eax, (%rdi)
	movq	%r15, %rax
	cmovl	%ecx, %r9d
	movq	%r8, %rcx
	.p2align 4,,10
	.p2align 3
.L10:
	cmpb	$1, (%rcx)
	jne	.L8
	movl	(%rax), %esi
	addl	$1, %esi
	leal	(%r9,%rsi), %ebp
	cmpl	$2, %esi
	movl	%esi, (%rax)
	cmovl	%ebp, %r9d
.L8:
	addq	$4, %rax
	addq	$1, %rcx
	cmpq	%r10, %rax
	jne	.L10
	jmp	.L6
.L14:
	xorl	%r9d, %r9d
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%r9d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L2:
	movq	253064(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$253080, %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
.L20:
	.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 ;
	while( 1 )
	{
		int ans =  0 ;

		int I[ 500 + 1 ] = { 0 } ;
		char friends[ 500 + 1 ][ 500 + 1 ] = { 0 } ;

		scanf( "%d %d" ,&N ,&M ) ;

		if( N | M )
		{
			int i ,j ;
			for( i = 0 ; i < M ; ++i )
			{
				int a ,b ;
				scanf( "%d %d" ,&a ,&b ) ;

				friends[ a ][ b ] = friends[ b ][ a ] = 1 ;
			}

			for( i = 2 ; i <= N ; ++i )
			{
				if( friends[ 1 ][ i ] == 1 )
				{
					++I[ i ] ;

					ans += I[ i ] < 2 ? I[ i ] : 0 ;

					for( j = 2 ; j <= N ; ++j )
					{
						if( friends[ i ][ j ] == 1 )
						{
							++I[ j ] ;

							ans += I[ j ] < 2 ? I[ j ] : 0 ;
						}
					}
				}
			}

			printf( "%d\n" ,ans ) ;
		}

		else
		{
			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 ;
	while( 1 )
	{
		int ans =  0 ;

		int I[ 500 + 1 ] = { 0 } ;
		char friends[ 500 + 1 ][ 500 + 1 ] = { 0 } ;

		scanf( "%d %d" ,&N ,&M ) ;

		if( N | M )
		{
			int i ,j ;
			for( i = 0 ; i < M ; ++i )
			{
				int a ,b ;
				scanf( "%d %d" ,&a ,&b ) ;

				friends[ a ][ b ] = friends[ b ][ a ] = 1 ;
			}

			for( i = 2 ; i <= N ; ++i )
			{
				if( friends[ 1 ][ i ] == 1 )
				{
					++I[ i ] ;

					ans += I[ i ] < 2 ? I[ i ] : 0 ;

					for( j = 2 ; j <= N ; ++j )
					{
						if( friends[ i ][ j ] == 1 )
						{
							++I[ j ] ;

							ans += I[ j ] < 2 ? I[ j ] : 0 ;
						}
					}
				}
			}

			printf( "%d\n" ,ans ) ;
		}

		else
		{
			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	$3216, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L15:
	movl	$0, -253052(%rbp)
	leaq	-253040(%rbp), %rdx
	movl	$0, %eax
	movl	$250, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	leaq	-251024(%rbp), %rax
	movl	$251001, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	leaq	-253064(%rbp), %rdx
	leaq	-253068(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-253068(%rbp), %edx
	movl	-253064(%rbp), %eax
	orl	%edx, %eax
	testl	%eax, %eax
	je	.L2
	movl	$0, -253048(%rbp)
	jmp	.L3
.L4:
	leaq	-253056(%rbp), %rdx
	leaq	-253060(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-253056(%rbp), %eax
	movl	-253060(%rbp), %edx
	movslq	%edx, %rsi
	movslq	%eax, %rcx
	imulq	$501, %rcx, %rcx
	addq	%rbp, %rcx
	addq	%rsi, %rcx
	subq	$251024, %rcx
	movb	$1, (%rcx)
	movl	-253060(%rbp), %ecx
	movl	-253056(%rbp), %esi
	movslq	%edx, %rdx
	cltq
	imulq	$501, %rax, %rax
	addq	%rbp, %rax
	addq	%rdx, %rax
	subq	$251024, %rax
	movzbl	(%rax), %eax
	movslq	%esi, %rsi
	movslq	%ecx, %rdx
	imulq	$501, %rdx, %rdx
	addq	%rbp, %rdx
	addq	%rsi, %rdx
	subq	$251024, %rdx
	movb	%al, (%rdx)
	addl	$1, -253048(%rbp)
.L3:
	movl	-253064(%rbp), %eax
	cmpl	%eax, -253048(%rbp)
	jl	.L4
	movl	$2, -253048(%rbp)
	jmp	.L5
.L14:
	movl	-253048(%rbp), %eax
	cltq
	movzbl	-250523(%rbp,%rax), %eax
	cmpb	$1, %al
	jne	.L6
	movl	-253048(%rbp), %eax
	cltq
	movl	-253040(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-253048(%rbp), %eax
	cltq
	movl	%edx, -253040(%rbp,%rax,4)
	movl	-253048(%rbp), %eax
	cltq
	movl	-253040(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jg	.L7
	movl	-253048(%rbp), %eax
	cltq
	movl	-253040(%rbp,%rax,4), %eax
	jmp	.L8
.L7:
	movl	$0, %eax
.L8:
	addl	%eax, -253052(%rbp)
	movl	$2, -253044(%rbp)
	jmp	.L9
.L13:
	movl	-253044(%rbp), %eax
	movslq	%eax, %rdx
	movl	-253048(%rbp), %eax
	cltq
	imulq	$501, %rax, %rax
	addq	%rbp, %rax
	addq	%rdx, %rax
	subq	$251024, %rax
	movzbl	(%rax), %eax
	cmpb	$1, %al
	jne	.L10
	movl	-253044(%rbp), %eax
	cltq
	movl	-253040(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-253044(%rbp), %eax
	cltq
	movl	%edx, -253040(%rbp,%rax,4)
	movl	-253044(%rbp), %eax
	cltq
	movl	-253040(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jg	.L11
	movl	-253044(%rbp), %eax
	cltq
	movl	-253040(%rbp,%rax,4), %eax
	jmp	.L12
.L11:
	movl	$0, %eax
.L12:
	addl	%eax, -253052(%rbp)
.L10:
	addl	$1, -253044(%rbp)
.L9:
	movl	-253068(%rbp), %eax
	cmpl	%eax, -253044(%rbp)
	jle	.L13
.L6:
	addl	$1, -253048(%rbp)
.L5:
	movl	-253068(%rbp), %eax
	cmpl	%eax, -253048(%rbp)
	jle	.L14
	movl	-253052(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L15
.L2:
	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	$3216, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L15:
	movl	$0, -253052(%rbp)
	leaq	-253040(%rbp), %rdx
	movl	$0, %eax
	movl	$250, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	leaq	-251024(%rbp), %rax
	movl	$251001, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	leaq	-253064(%rbp), %rdx
	leaq	-253068(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-253068(%rbp), %edx
	movl	-253064(%rbp), %eax
	orl	%edx, %eax
	testl	%eax, %eax
	je	.L2
	movl	$0, -253048(%rbp)
	jmp	.L3
.L4:
	leaq	-253056(%rbp), %rdx
	leaq	-253060(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-253056(%rbp), %eax
	movl	-253060(%rbp), %edx
	movslq	%edx, %rsi
	movslq	%eax, %rcx
	imulq	$501, %rcx, %rcx
	addq	%rbp, %rcx
	addq	%rsi, %rcx
	subq	$251024, %rcx
	movb	$1, (%rcx)
	movl	-253060(%rbp), %ecx
	movl	-253056(%rbp), %esi
	movslq	%edx, %rdx
	cltq
	imulq	$501, %rax, %rax
	addq	%rbp, %rax
	addq	%rdx, %rax
	subq	$251024, %rax
	movzbl	(%rax), %eax
	movslq	%esi, %rsi
	movslq	%ecx, %rdx
	imulq	$501, %rdx, %rdx
	addq	%rbp, %rdx
	addq	%rsi, %rdx
	subq	$251024, %rdx
	movb	%al, (%rdx)
	addl	$1, -253048(%rbp)
.L3:
	movl	-253064(%rbp), %eax
	cmpl	%eax, -253048(%rbp)
	jl	.L4
	movl	$2, -253048(%rbp)
	jmp	.L5
.L14:
	movl	-253048(%rbp), %eax
	cltq
	movzbl	-250523(%rbp,%rax), %eax
	cmpb	$1, %al
	jne	.L6
	movl	-253048(%rbp), %eax
	cltq
	movl	-253040(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-253048(%rbp), %eax
	cltq
	movl	%edx, -253040(%rbp,%rax,4)
	movl	-253048(%rbp), %eax
	cltq
	movl	-253040(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jg	.L7
	movl	-253048(%rbp), %eax
	cltq
	movl	-253040(%rbp,%rax,4), %eax
	jmp	.L8
.L7:
	movl	$0, %eax
.L8:
	addl	%eax, -253052(%rbp)
	movl	$2, -253044(%rbp)
	jmp	.L9
.L13:
	movl	-253044(%rbp), %eax
	movslq	%eax, %rdx
	movl	-253048(%rbp), %eax
	cltq
	imulq	$501, %rax, %rax
	addq	%rbp, %rax
	addq	%rdx, %rax
	subq	$251024, %rax
	movzbl	(%rax), %eax
	cmpb	$1, %al
	jne	.L10
	movl	-253044(%rbp), %eax
	cltq
	movl	-253040(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-253044(%rbp), %eax
	cltq
	movl	%edx, -253040(%rbp,%rax,4)
	movl	-253044(%rbp), %eax
	cltq
	movl	-253040(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jg	.L11
	movl	-253044(%rbp), %eax
	cltq
	movl	-253040(%rbp,%rax,4), %eax
	jmp	.L12
.L11:
	movl	$0, %eax
.L12:
	addl	%eax, -253052(%rbp)
.L10:
	addl	$1, -253044(%rbp)
.L9:
	movl	-253068(%rbp), %eax
	cmpl	%eax, -253044(%rbp)
	jle	.L13
.L6:
	addl	$1, -253048(%rbp)
.L5:
	movl	-253068(%rbp), %eax
	cmpl	%eax, -253048(%rbp)
	jle	.L14
	movl	-253052(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L15
.L2:
	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:
