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 M=100000000;
  int n,m,i,u,s,c[510],f[20010],t[20010];
  while(scanf("%d %d",&n,&m),n||m){
    for(i=u=1;i<=n;i++)c[i]=M;
    for(i=s=c[1]=0;i<m*2;i+=2){
      scanf("%d %d",&f[i],&t[i]);
      f[i+1]=t[i];
      t[i+1]=f[i];
    }
    while(u){
      for(i=u=0;i<=m*2;i++){
	if(c[f[i]]==M||c[t[i]]<=c[f[i]]+1)continue;
	c[t[i]]=c[f[i]]+1;
	u=1;
      }
    }
    for(i=2;i<=n;i++){
      if(c[i]<3)s++;
    }
    printf("%d\n",s);
  }
  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	-159744(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2432, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$100000000, -162148(%rbp)
	jmp	.L2
.L20:
	movl	$1, -162156(%rbp)
	movl	-162156(%rbp), %eax
	movl	%eax, -162160(%rbp)
	jmp	.L3
.L4:
	movl	-162160(%rbp), %eax
	cltq
	movl	-162148(%rbp), %edx
	movl	%edx, -162144(%rbp,%rax,4)
	addl	$1, -162160(%rbp)
.L3:
	movl	-162168(%rbp), %eax
	cmpl	%eax, -162160(%rbp)
	jle	.L4
	movl	$0, -162140(%rbp)
	movl	-162140(%rbp), %eax
	movl	%eax, -162152(%rbp)
	movl	-162152(%rbp), %eax
	movl	%eax, -162160(%rbp)
	jmp	.L5
.L6:
	leaq	-80048(%rbp), %rdx
	movl	-162160(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-160096(%rbp), %rcx
	movl	-162160(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-162160(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-162160(%rbp), %eax
	cltq
	movl	-80048(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -160096(%rbp,%rax,4)
	movl	-162160(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-162160(%rbp), %eax
	cltq
	movl	-160096(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -80048(%rbp,%rax,4)
	addl	$2, -162160(%rbp)
.L5:
	movl	-162164(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -162160(%rbp)
	jl	.L6
	jmp	.L7
.L13:
	movl	$0, -162156(%rbp)
	movl	-162156(%rbp), %eax
	movl	%eax, -162160(%rbp)
	jmp	.L8
.L12:
	movl	-162160(%rbp), %eax
	cltq
	movl	-160096(%rbp,%rax,4), %eax
	cltq
	movl	-162144(%rbp,%rax,4), %eax
	cmpl	%eax, -162148(%rbp)
	je	.L23
	movl	-162160(%rbp), %eax
	cltq
	movl	-80048(%rbp,%rax,4), %eax
	cltq
	movl	-162144(%rbp,%rax,4), %edx
	movl	-162160(%rbp), %eax
	cltq
	movl	-160096(%rbp,%rax,4), %eax
	cltq
	movl	-162144(%rbp,%rax,4), %eax
	addl	$1, %eax
	cmpl	%eax, %edx
	jle	.L23
	movl	-162160(%rbp), %eax
	cltq
	movl	-160096(%rbp,%rax,4), %eax
	cltq
	movl	-162144(%rbp,%rax,4), %edx
	movl	-162160(%rbp), %eax
	cltq
	movl	-80048(%rbp,%rax,4), %eax
	addl	$1, %edx
	cltq
	movl	%edx, -162144(%rbp,%rax,4)
	movl	$1, -162156(%rbp)
	jmp	.L11
.L23:
	nop
.L11:
	addl	$1, -162160(%rbp)
.L8:
	movl	-162164(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -162160(%rbp)
	jle	.L12
.L7:
	cmpl	$0, -162156(%rbp)
	jne	.L13
	movl	$2, -162160(%rbp)
	jmp	.L14
.L16:
	movl	-162160(%rbp), %eax
	cltq
	movl	-162144(%rbp,%rax,4), %eax
	cmpl	$2, %eax
	jg	.L15
	addl	$1, -162152(%rbp)
.L15:
	addl	$1, -162160(%rbp)
.L14:
	movl	-162168(%rbp), %eax
	cmpl	%eax, -162160(%rbp)
	jle	.L16
	movl	-162152(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-162164(%rbp), %rdx
	leaq	-162168(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-162168(%rbp), %eax
	testl	%eax, %eax
	jne	.L17
	movl	-162164(%rbp), %eax
	testl	%eax, %eax
	je	.L18
.L17:
	movl	$1, %eax
	jmp	.L19
.L18:
	movl	$0, %eax
.L19:
	testl	%eax, %eax
	jne	.L20
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	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
.LC1:
	.string	"%d %d"
.LC3:
	.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	-159744(%rsp), %r11
	.cfi_def_cfa 11, 159800
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2424, %rsp
	.cfi_def_cfa_offset 162224
	leaq	.LC1(%rip), %rbx
	movq	%fs:40, %rax
	movq	%rax, 162152(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %r12
	leaq	8(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbx, %rdi
	movq	%r12, %rdx
	movq	%rbp, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %r10d
	movl	12(%rsp), %edi
	testl	%r10d, %r10d
	jne	.L43
	testl	%edi, %edi
	je	.L44
.L24:
	addl	%edi, %edi
	movl	$0, 20(%rsp)
	testl	%edi, %edi
	jle	.L41
	leaq	2064(%rsp), %r14
	leaq	82112(%rsp), %r13
	xorl	%r15d, %r15d
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r13, %rdx
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	0(%r13), %eax
	addl	$2, %r15d
	addq	$8, %r14
	addq	$8, %r13
	movl	%eax, -4(%r14)
	movl	-8(%r14), %eax
	movl	%eax, -4(%r13)
	movl	12(%rsp), %eax
	leal	(%rax,%rax), %edi
	cmpl	%r15d, %edi
	jg	.L7
	movl	8(%rsp), %r10d
	.p2align 4,,10
	.p2align 3
.L41:
	xorl	%r9d, %r9d
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L8:
	cmpl	%edi, %ecx
	jg	.L45
.L11:
	movslq	%ecx, %rdx
	leaq	2064(%rsp), %r8
.L10:
	movslq	(%r8,%rdx,4), %rax
	leal	1(%rdx), %ecx
	movl	16(%rsp,%rax,4), %eax
	cmpl	$100000000, %eax
	je	.L8
	movslq	82112(%rsp,%rdx,4), %rsi
	addl	$1, %eax
	cmpl	%eax, 16(%rsp,%rsi,4)
	jle	.L8
	addq	$1, %rdx
	movl	%eax, 16(%rsp,%rsi,4)
	movl	$1, %r9d
	cmpl	%edx, %edi
	jge	.L10
	jmp	.L41
	.p2align 4,,10
	.p2align 3
.L45:
	testl	%r9d, %r9d
	je	.L12
	testl	%edi, %edi
	js	.L12
	xorl	%r9d, %r9d
	xorl	%ecx, %ecx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L12:
	cmpl	$1, %r10d
	jle	.L28
	leal	-2(%r10), %eax
	leal	-1(%r10), %ecx
	cmpl	$2, %eax
	jbe	.L29
	movl	%ecx, %edx
	pxor	%xmm1, %xmm1
	leaq	24(%rsp), %rax
	shrl	$2, %edx
	movdqa	%xmm1, %xmm2
	subl	$1, %edx
	salq	$4, %rdx
	leaq	40(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L15:
	movdqu	(%rax), %xmm0
	addq	$16, %rax
	pcmpgtd	.LC2(%rip), %xmm0
	pcmpeqd	%xmm2, %xmm0
	psubd	%xmm0, %xmm1
	cmpq	%rax, %rdx
	jne	.L15
	movdqa	%xmm1, %xmm0
	movl	%ecx, %esi
	psrldq	$8, %xmm0
	andl	$-4, %esi
	paddd	%xmm0, %xmm1
	leal	2(%rsi), %eax
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %edx
	cmpl	%esi, %ecx
	je	.L13
.L14:
	movslq	%eax, %rcx
	cmpl	$2, 16(%rsp,%rcx,4)
	jg	.L18
	addl	$1, %edx
.L18:
	leal	1(%rax), %ecx
	cmpl	%r10d, %ecx
	jg	.L13
	movslq	%ecx, %rcx
	cmpl	$2, 16(%rsp,%rcx,4)
	jg	.L19
	addl	$1, %edx
.L19:
	addl	$2, %eax
	cmpl	%eax, %r10d
	jl	.L13
	cltq
	cmpl	$2, 16(%rsp,%rax,4)
	jg	.L13
	addl	$1, %edx
.L13:
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L43:
	jle	.L24
	leal	-1(%r10), %eax
	cmpl	$2, %eax
	jbe	.L26
	movl	%r10d, %edx
	leaq	20(%rsp), %rax
	shrl	$2, %edx
	subl	$1, %edx
	salq	$4, %rdx
	leaq	36(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L4:
	movdqa	.LC0(%rip), %xmm3
	addq	$16, %rax
	movups	%xmm3, -16(%rax)
	cmpq	%rdx, %rax
	jne	.L4
	movl	%r10d, %edx
	andl	$-4, %edx
	leal	1(%rdx), %eax
	cmpl	%edx, %r10d
	je	.L24
.L3:
	movslq	%eax, %rdx
	movl	$100000000, 16(%rsp,%rdx,4)
	leal	1(%rax), %edx
	cmpl	%edx, %r10d
	jl	.L24
	movslq	%edx, %rdx
	addl	$2, %eax
	movl	$100000000, 16(%rsp,%rdx,4)
	cmpl	%eax, %r10d
	jl	.L24
	cltq
	movl	$100000000, 16(%rsp,%rax,4)
	jmp	.L24
.L28:
	xorl	%edx, %edx
	jmp	.L13
.L29:
	xorl	%edx, %edx
	movl	$2, %eax
	jmp	.L14
.L26:
	movl	$1, %eax
	jmp	.L3
.L44:
	movq	162152(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L46
	addq	$162168, %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
.L46:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	100000000
	.long	100000000
	.long	100000000
	.long	100000000
	.align 16
.LC2:
	.long	2
	.long	2
	.long	2
	.long	2
	.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
.LC1:
	.string	"%d %d"
.LC3:
	.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	-159744(%rsp), %r11
	.cfi_def_cfa 11, 159800
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2424, %rsp
	.cfi_def_cfa_offset 162224
	leaq	.LC1(%rip), %rbx
	movq	%fs:40, %rax
	movq	%rax, 162152(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %r12
	leaq	8(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbx, %rdi
	movq	%r12, %rdx
	movq	%rbp, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %r10d
	movl	12(%rsp), %edi
	testl	%r10d, %r10d
	jne	.L43
	testl	%edi, %edi
	je	.L44
.L24:
	addl	%edi, %edi
	movl	$0, 20(%rsp)
	testl	%edi, %edi
	jle	.L41
	leaq	2064(%rsp), %r14
	leaq	82112(%rsp), %r13
	xorl	%r15d, %r15d
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r13, %rdx
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	0(%r13), %eax
	addl	$2, %r15d
	addq	$8, %r14
	addq	$8, %r13
	movl	%eax, -4(%r14)
	movl	-8(%r14), %eax
	movl	%eax, -4(%r13)
	movl	12(%rsp), %eax
	leal	(%rax,%rax), %edi
	cmpl	%r15d, %edi
	jg	.L7
	movl	8(%rsp), %r10d
	.p2align 4,,10
	.p2align 3
.L41:
	xorl	%r9d, %r9d
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L8:
	cmpl	%edi, %ecx
	jg	.L45
.L11:
	movslq	%ecx, %rdx
	leaq	2064(%rsp), %r8
.L10:
	movslq	(%r8,%rdx,4), %rax
	leal	1(%rdx), %ecx
	movl	16(%rsp,%rax,4), %eax
	cmpl	$100000000, %eax
	je	.L8
	movslq	82112(%rsp,%rdx,4), %rsi
	addl	$1, %eax
	cmpl	%eax, 16(%rsp,%rsi,4)
	jle	.L8
	addq	$1, %rdx
	movl	%eax, 16(%rsp,%rsi,4)
	movl	$1, %r9d
	cmpl	%edx, %edi
	jge	.L10
	jmp	.L41
	.p2align 4,,10
	.p2align 3
.L45:
	testl	%r9d, %r9d
	je	.L12
	testl	%edi, %edi
	js	.L12
	xorl	%r9d, %r9d
	xorl	%ecx, %ecx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L12:
	cmpl	$1, %r10d
	jle	.L28
	leal	-2(%r10), %eax
	leal	-1(%r10), %ecx
	cmpl	$2, %eax
	jbe	.L29
	movl	%ecx, %edx
	pxor	%xmm1, %xmm1
	leaq	24(%rsp), %rax
	shrl	$2, %edx
	movdqa	%xmm1, %xmm2
	subl	$1, %edx
	salq	$4, %rdx
	leaq	40(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L15:
	movdqu	(%rax), %xmm0
	addq	$16, %rax
	pcmpgtd	.LC2(%rip), %xmm0
	pcmpeqd	%xmm2, %xmm0
	psubd	%xmm0, %xmm1
	cmpq	%rax, %rdx
	jne	.L15
	movdqa	%xmm1, %xmm0
	movl	%ecx, %esi
	psrldq	$8, %xmm0
	andl	$-4, %esi
	paddd	%xmm0, %xmm1
	leal	2(%rsi), %eax
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %edx
	cmpl	%esi, %ecx
	je	.L13
.L14:
	movslq	%eax, %rcx
	cmpl	$2, 16(%rsp,%rcx,4)
	jg	.L18
	addl	$1, %edx
.L18:
	leal	1(%rax), %ecx
	cmpl	%r10d, %ecx
	jg	.L13
	movslq	%ecx, %rcx
	cmpl	$2, 16(%rsp,%rcx,4)
	jg	.L19
	addl	$1, %edx
.L19:
	addl	$2, %eax
	cmpl	%eax, %r10d
	jl	.L13
	cltq
	cmpl	$2, 16(%rsp,%rax,4)
	jg	.L13
	addl	$1, %edx
.L13:
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L43:
	jle	.L24
	leal	-1(%r10), %eax
	cmpl	$2, %eax
	jbe	.L26
	movl	%r10d, %edx
	leaq	20(%rsp), %rax
	shrl	$2, %edx
	subl	$1, %edx
	salq	$4, %rdx
	leaq	36(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L4:
	movdqa	.LC0(%rip), %xmm3
	addq	$16, %rax
	movups	%xmm3, -16(%rax)
	cmpq	%rdx, %rax
	jne	.L4
	movl	%r10d, %edx
	andl	$-4, %edx
	leal	1(%rdx), %eax
	cmpl	%edx, %r10d
	je	.L24
.L3:
	movslq	%eax, %rdx
	movl	$100000000, 16(%rsp,%rdx,4)
	leal	1(%rax), %edx
	cmpl	%edx, %r10d
	jl	.L24
	movslq	%edx, %rdx
	addl	$2, %eax
	movl	$100000000, 16(%rsp,%rdx,4)
	cmpl	%eax, %r10d
	jl	.L24
	cltq
	movl	$100000000, 16(%rsp,%rax,4)
	jmp	.L24
.L28:
	xorl	%edx, %edx
	jmp	.L13
.L29:
	xorl	%edx, %edx
	movl	$2, %eax
	jmp	.L14
.L26:
	movl	$1, %eax
	jmp	.L3
.L44:
	movq	162152(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L46
	addq	$162168, %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
.L46:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	100000000
	.long	100000000
	.long	100000000
	.long	100000000
	.align 16
.LC2:
	.long	2
	.long	2
	.long	2
	.long	2
	.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 M=100000000;
  int n,m,i,u,s,c[510],f[20010],t[20010];
  while(scanf("%d %d",&n,&m),n||m){
    for(i=u=1;i<=n;i++)c[i]=M;
    for(i=s=c[1]=0;i<m*2;i+=2){
      scanf("%d %d",&f[i],&t[i]);
      f[i+1]=t[i];
      t[i+1]=f[i];
    }
    while(u){
      for(i=u=0;i<=m*2;i++){
	if(c[f[i]]==M||c[t[i]]<=c[f[i]]+1)continue;
	c[t[i]]=c[f[i]]+1;
	u=1;
      }
    }
    for(i=2;i<=n;i++){
      if(c[i]<3)s++;
    }
    printf("%d\n",s);
  }
  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 M=100000000;
  int n,m,i,u,s,c[510],f[20010],t[20010];
  while(scanf("%d %d",&n,&m),n||m){
    for(i=u=1;i<=n;i++)c[i]=M;
    for(i=s=c[1]=0;i<m*2;i+=2){
      scanf("%d %d",&f[i],&t[i]);
      f[i+1]=t[i];
      t[i+1]=f[i];
    }
    while(u){
      for(i=u=0;i<=m*2;i++){
	if(c[f[i]]==M||c[t[i]]<=c[f[i]]+1)continue;
	c[t[i]]=c[f[i]]+1;
	u=1;
      }
    }
    for(i=2;i<=n;i++){
      if(c[i]<3)s++;
    }
    printf("%d\n",s);
  }
  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	-159744(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2432, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$100000000, -162148(%rbp)
	jmp	.L2
.L20:
	movl	$1, -162156(%rbp)
	movl	-162156(%rbp), %eax
	movl	%eax, -162160(%rbp)
	jmp	.L3
.L4:
	movl	-162160(%rbp), %eax
	cltq
	movl	-162148(%rbp), %edx
	movl	%edx, -162144(%rbp,%rax,4)
	addl	$1, -162160(%rbp)
.L3:
	movl	-162168(%rbp), %eax
	cmpl	%eax, -162160(%rbp)
	jle	.L4
	movl	$0, -162140(%rbp)
	movl	-162140(%rbp), %eax
	movl	%eax, -162152(%rbp)
	movl	-162152(%rbp), %eax
	movl	%eax, -162160(%rbp)
	jmp	.L5
.L6:
	leaq	-80048(%rbp), %rdx
	movl	-162160(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-160096(%rbp), %rcx
	movl	-162160(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-162160(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-162160(%rbp), %eax
	cltq
	movl	-80048(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -160096(%rbp,%rax,4)
	movl	-162160(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-162160(%rbp), %eax
	cltq
	movl	-160096(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -80048(%rbp,%rax,4)
	addl	$2, -162160(%rbp)
.L5:
	movl	-162164(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -162160(%rbp)
	jl	.L6
	jmp	.L7
.L13:
	movl	$0, -162156(%rbp)
	movl	-162156(%rbp), %eax
	movl	%eax, -162160(%rbp)
	jmp	.L8
.L12:
	movl	-162160(%rbp), %eax
	cltq
	movl	-160096(%rbp,%rax,4), %eax
	cltq
	movl	-162144(%rbp,%rax,4), %eax
	cmpl	%eax, -162148(%rbp)
	je	.L23
	movl	-162160(%rbp), %eax
	cltq
	movl	-80048(%rbp,%rax,4), %eax
	cltq
	movl	-162144(%rbp,%rax,4), %edx
	movl	-162160(%rbp), %eax
	cltq
	movl	-160096(%rbp,%rax,4), %eax
	cltq
	movl	-162144(%rbp,%rax,4), %eax
	addl	$1, %eax
	cmpl	%eax, %edx
	jle	.L23
	movl	-162160(%rbp), %eax
	cltq
	movl	-160096(%rbp,%rax,4), %eax
	cltq
	movl	-162144(%rbp,%rax,4), %edx
	movl	-162160(%rbp), %eax
	cltq
	movl	-80048(%rbp,%rax,4), %eax
	addl	$1, %edx
	cltq
	movl	%edx, -162144(%rbp,%rax,4)
	movl	$1, -162156(%rbp)
	jmp	.L11
.L23:
	nop
.L11:
	addl	$1, -162160(%rbp)
.L8:
	movl	-162164(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -162160(%rbp)
	jle	.L12
.L7:
	cmpl	$0, -162156(%rbp)
	jne	.L13
	movl	$2, -162160(%rbp)
	jmp	.L14
.L16:
	movl	-162160(%rbp), %eax
	cltq
	movl	-162144(%rbp,%rax,4), %eax
	cmpl	$2, %eax
	jg	.L15
	addl	$1, -162152(%rbp)
.L15:
	addl	$1, -162160(%rbp)
.L14:
	movl	-162168(%rbp), %eax
	cmpl	%eax, -162160(%rbp)
	jle	.L16
	movl	-162152(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-162164(%rbp), %rdx
	leaq	-162168(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-162168(%rbp), %eax
	testl	%eax, %eax
	jne	.L17
	movl	-162164(%rbp), %eax
	testl	%eax, %eax
	je	.L18
.L17:
	movl	$1, %eax
	jmp	.L19
.L18:
	movl	$0, %eax
.L19:
	testl	%eax, %eax
	jne	.L20
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	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	-159744(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2432, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$100000000, -162148(%rbp)
	jmp	.L2
.L20:
	movl	$1, -162156(%rbp)
	movl	-162156(%rbp), %eax
	movl	%eax, -162160(%rbp)
	jmp	.L3
.L4:
	movl	-162160(%rbp), %eax
	cltq
	movl	-162148(%rbp), %edx
	movl	%edx, -162144(%rbp,%rax,4)
	addl	$1, -162160(%rbp)
.L3:
	movl	-162168(%rbp), %eax
	cmpl	%eax, -162160(%rbp)
	jle	.L4
	movl	$0, -162140(%rbp)
	movl	-162140(%rbp), %eax
	movl	%eax, -162152(%rbp)
	movl	-162152(%rbp), %eax
	movl	%eax, -162160(%rbp)
	jmp	.L5
.L6:
	leaq	-80048(%rbp), %rdx
	movl	-162160(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-160096(%rbp), %rcx
	movl	-162160(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-162160(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-162160(%rbp), %eax
	cltq
	movl	-80048(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -160096(%rbp,%rax,4)
	movl	-162160(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-162160(%rbp), %eax
	cltq
	movl	-160096(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -80048(%rbp,%rax,4)
	addl	$2, -162160(%rbp)
.L5:
	movl	-162164(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -162160(%rbp)
	jl	.L6
	jmp	.L7
.L13:
	movl	$0, -162156(%rbp)
	movl	-162156(%rbp), %eax
	movl	%eax, -162160(%rbp)
	jmp	.L8
.L12:
	movl	-162160(%rbp), %eax
	cltq
	movl	-160096(%rbp,%rax,4), %eax
	cltq
	movl	-162144(%rbp,%rax,4), %eax
	cmpl	%eax, -162148(%rbp)
	je	.L23
	movl	-162160(%rbp), %eax
	cltq
	movl	-80048(%rbp,%rax,4), %eax
	cltq
	movl	-162144(%rbp,%rax,4), %edx
	movl	-162160(%rbp), %eax
	cltq
	movl	-160096(%rbp,%rax,4), %eax
	cltq
	movl	-162144(%rbp,%rax,4), %eax
	addl	$1, %eax
	cmpl	%eax, %edx
	jle	.L23
	movl	-162160(%rbp), %eax
	cltq
	movl	-160096(%rbp,%rax,4), %eax
	cltq
	movl	-162144(%rbp,%rax,4), %edx
	movl	-162160(%rbp), %eax
	cltq
	movl	-80048(%rbp,%rax,4), %eax
	addl	$1, %edx
	cltq
	movl	%edx, -162144(%rbp,%rax,4)
	movl	$1, -162156(%rbp)
	jmp	.L11
.L23:
	nop
.L11:
	addl	$1, -162160(%rbp)
.L8:
	movl	-162164(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -162160(%rbp)
	jle	.L12
.L7:
	cmpl	$0, -162156(%rbp)
	jne	.L13
	movl	$2, -162160(%rbp)
	jmp	.L14
.L16:
	movl	-162160(%rbp), %eax
	cltq
	movl	-162144(%rbp,%rax,4), %eax
	cmpl	$2, %eax
	jg	.L15
	addl	$1, -162152(%rbp)
.L15:
	addl	$1, -162160(%rbp)
.L14:
	movl	-162168(%rbp), %eax
	cmpl	%eax, -162160(%rbp)
	jle	.L16
	movl	-162152(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-162164(%rbp), %rdx
	leaq	-162168(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-162168(%rbp), %eax
	testl	%eax, %eax
	jne	.L17
	movl	-162164(%rbp), %eax
	testl	%eax, %eax
	je	.L18
.L17:
	movl	$1, %eax
	jmp	.L19
.L18:
	movl	$0, %eax
.L19:
	testl	%eax, %eax
	jne	.L20
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	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:
