Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
main(n,m,a,b,i){for(;scanf("%d%d",&n,&m),n|m;printf("%d\n",a)){int f[510][510]={0};for(i=m;i--;f[a][b]=f[b][a]=1)scanf("%d%d",&a,&b);for(a=i=0;i<=n;i++)if(f[1][i])for(f[505][i]=b=1;b<=n;b++)f[i][b]?f[505][b]=1:0;for(;--i>1;)f[505][i]?a++:0;}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	-1040384(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$64, %rsp
	movl	%edi, -1040420(%rbp)
	movl	%esi, -1040424(%rbp)
	movl	%edx, -1040428(%rbp)
	movl	%ecx, -1040432(%rbp)
	movl	%r8d, -1040436(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L15:
	leaq	-1040416(%rbp), %rax
	movl	$1040400, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	-1040424(%rbp), %eax
	movl	%eax, -1040436(%rbp)
	jmp	.L3
.L4:
	leaq	-1040432(%rbp), %rdx
	leaq	-1040428(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-1040432(%rbp), %edx
	movl	-1040428(%rbp), %ecx
	movslq	%ecx, %rdi
	movslq	%edx, %rsi
	movq	%rsi, %rax
	salq	$8, %rax
	subq	%rsi, %rax
	addq	%rax, %rax
	addq	%rdi, %rax
	movl	$1, -1040416(%rbp,%rax,4)
	movl	-1040428(%rbp), %esi
	movl	-1040432(%rbp), %edi
	movslq	%ecx, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$8, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-1040416(%rbp,%rax,4), %edx
	movslq	%edi, %rdi
	movslq	%esi, %rcx
	movq	%rcx, %rax
	salq	$8, %rax
	subq	%rcx, %rax
	addq	%rax, %rax
	addq	%rdi, %rax
	movl	%edx, -1040416(%rbp,%rax,4)
.L3:
	movl	-1040436(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -1040436(%rbp)
	testl	%eax, %eax
	jne	.L4
	movl	$0, -1040436(%rbp)
	movl	-1040436(%rbp), %eax
	movl	%eax, -1040428(%rbp)
	jmp	.L5
.L11:
	movl	-1040436(%rbp), %eax
	cltq
	addq	$510, %rax
	movl	-1040416(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L6
	movl	$1, -1040432(%rbp)
	movl	-1040432(%rbp), %eax
	movl	-1040436(%rbp), %edx
	movslq	%edx, %rdx
	addq	$257550, %rdx
	movl	%eax, -1040416(%rbp,%rdx,4)
	jmp	.L7
.L10:
	movl	-1040432(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1040436(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$8, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-1040416(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L9
	movl	-1040432(%rbp), %eax
	cltq
	addq	$257550, %rax
	movl	$1, -1040416(%rbp,%rax,4)
.L9:
	movl	-1040432(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -1040432(%rbp)
.L7:
	movl	-1040432(%rbp), %edx
	movl	-1040420(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L10
.L6:
	addl	$1, -1040436(%rbp)
.L5:
	movl	-1040420(%rbp), %eax
	cmpl	%eax, -1040436(%rbp)
	jle	.L11
	jmp	.L12
.L14:
	movl	-1040436(%rbp), %eax
	cltq
	addq	$257550, %rax
	movl	-1040416(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L12
	movl	-1040428(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -1040428(%rbp)
.L12:
	subl	$1, -1040436(%rbp)
	cmpl	$1, -1040436(%rbp)
	jg	.L14
	movl	-1040428(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-1040424(%rbp), %rdx
	leaq	-1040420(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-1040420(%rbp), %edx
	movl	-1040424(%rbp), %eax
	orl	%edx, %eax
	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:
.LFB0:
	.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	-1040384(%rsp), %r11
	.cfi_def_cfa 11, 1040440
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$88, %rsp
	.cfi_def_cfa_offset 1040528
	leaq	.LC0(%rip), %rbp
	movl	%edi, 44(%rsp)
	leaq	48(%rsp), %r15
	leaq	32(%rsp), %r13
	movl	%esi, 40(%rsp)
	movl	%edx, 36(%rsp)
	movl	%ecx, 32(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 1040456(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movq	%rax, 8(%rsp)
	leaq	44(%rsp), %rax
	movq	%rax, 16(%rsp)
	movq	%rax, 24(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	8(%rsp), %rdx
	movq	16(%rsp), %rsi
	xorl	%eax, %eax
	movq	%rbp, %rdi
	call	scanf@PLT
	movl	44(%rsp), %r12d
	movl	40(%rsp), %ebx
	movl	%r12d, %eax
	orl	%ebx, %eax
	je	.L33
	xorl	%esi, %esi
	movl	$1040400, %edx
	movq	%r15, %rdi
	call	memset@PLT
	testl	%ebx, %ebx
	je	.L3
	leaq	36(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movslq	32(%rsp), %rax
	movslq	36(%rsp), %rcx
	movq	%rax, %rdx
	salq	$8, %rdx
	subq	%rax, %rdx
	leaq	(%rcx,%rdx,2), %rdx
	movl	$1, 48(%rsp,%rdx,4)
	movq	%rcx, %rdx
	salq	$8, %rdx
	subq	%rcx, %rdx
	leaq	(%rax,%rdx,2), %rax
	movl	$1, 48(%rsp,%rax,4)
	subl	$1, %ebx
	jne	.L4
	movl	44(%rsp), %r12d
.L3:
	movl	$0, 36(%rsp)
	testl	%r12d, %r12d
	js	.L12
	movslq	%r12d, %rdi
	leaq	2088(%rsp), %rcx
	xorl	%edx, %edx
	leaq	1(%rdi), %rax
	leal	1(%r12), %r9d
	movq	%rax, %r8
	salq	$8, %r8
	subq	%rax, %r8
	leal	-1(%r12), %eax
	leaq	1030256(%rsp,%rax,4), %rsi
	salq	$3, %r8
	xorl	%eax, %eax
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L7:
	addq	$2040, %rdx
	addq	$4, %rcx
	cmpq	%r8, %rdx
	je	.L34
.L10:
	movl	(%rcx), %r11d
	testl	%r11d, %r11d
	je	.L7
	movl	$1, 1028160(%rcx)
	testl	%r12d, %r12d
	je	.L17
	leaq	1030252(%rsp), %rax
	.p2align 4,,10
	.p2align 3
.L9:
	movl	-1030200(%rax,%rdx), %r10d
	testl	%r10d, %r10d
	je	.L8
	movl	$1, (%rax)
.L8:
	addq	$4, %rax
	cmpq	%rsi, %rax
	jne	.L9
	addq	$2040, %rdx
	movl	%r9d, %r14d
	movl	$1, %eax
	addq	$4, %rcx
	cmpq	%r8, %rdx
	jne	.L10
.L34:
	testb	%al, %al
	je	.L11
	movl	%r14d, 32(%rsp)
.L11:
	cmpl	$1, %r12d
	jle	.L12
	leaq	0(,%rdi,4), %rdx
	leal	-2(%r12), %ecx
	xorl	%esi, %esi
	salq	$2, %rcx
	leaq	(%r15,%rdx), %rax
	addq	24(%rsp), %rdx
	subq	%rcx, %rdx
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L14:
	movl	1030200(%rax), %edi
	testl	%edi, %edi
	je	.L13
	addl	$1, %esi
	movl	$1, %ecx
.L13:
	subq	$4, %rax
	cmpq	%rax, %rdx
	jne	.L14
	testb	%cl, %cl
	je	.L12
	movl	%esi, 36(%rsp)
.L6:
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	printf@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L12:
	xorl	%esi, %esi
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L17:
	movl	$1, %eax
	movl	$1, %r14d
	jmp	.L7
.L33:
	movq	1040456(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L35
	addq	$1040472, %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
.L35:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.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:

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:
.LFB0:
	.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	-1040384(%rsp), %r11
	.cfi_def_cfa 11, 1040440
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$88, %rsp
	.cfi_def_cfa_offset 1040528
	leaq	.LC0(%rip), %rbp
	movl	%edi, 44(%rsp)
	leaq	48(%rsp), %r15
	leaq	32(%rsp), %r13
	movl	%esi, 40(%rsp)
	movl	%edx, 36(%rsp)
	movl	%ecx, 32(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 1040456(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movq	%rax, 8(%rsp)
	leaq	44(%rsp), %rax
	movq	%rax, 16(%rsp)
	movq	%rax, 24(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	8(%rsp), %rdx
	movq	16(%rsp), %rsi
	xorl	%eax, %eax
	movq	%rbp, %rdi
	call	scanf@PLT
	movl	44(%rsp), %r12d
	movl	40(%rsp), %ebx
	movl	%r12d, %eax
	orl	%ebx, %eax
	je	.L33
	xorl	%esi, %esi
	movl	$1040400, %edx
	movq	%r15, %rdi
	call	memset@PLT
	testl	%ebx, %ebx
	je	.L3
	leaq	36(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movslq	32(%rsp), %rax
	movslq	36(%rsp), %rcx
	movq	%rax, %rdx
	salq	$8, %rdx
	subq	%rax, %rdx
	leaq	(%rcx,%rdx,2), %rdx
	movl	$1, 48(%rsp,%rdx,4)
	movq	%rcx, %rdx
	salq	$8, %rdx
	subq	%rcx, %rdx
	leaq	(%rax,%rdx,2), %rax
	movl	$1, 48(%rsp,%rax,4)
	subl	$1, %ebx
	jne	.L4
	movl	44(%rsp), %r12d
.L3:
	movl	$0, 36(%rsp)
	testl	%r12d, %r12d
	js	.L12
	movslq	%r12d, %rdi
	leaq	2088(%rsp), %rcx
	xorl	%edx, %edx
	leaq	1(%rdi), %rax
	leal	1(%r12), %r9d
	movq	%rax, %r8
	salq	$8, %r8
	subq	%rax, %r8
	leal	-1(%r12), %eax
	leaq	1030256(%rsp,%rax,4), %rsi
	salq	$3, %r8
	xorl	%eax, %eax
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L7:
	addq	$2040, %rdx
	addq	$4, %rcx
	cmpq	%r8, %rdx
	je	.L34
.L10:
	movl	(%rcx), %r11d
	testl	%r11d, %r11d
	je	.L7
	movl	$1, 1028160(%rcx)
	testl	%r12d, %r12d
	je	.L17
	leaq	1030252(%rsp), %rax
	.p2align 4,,10
	.p2align 3
.L9:
	movl	-1030200(%rax,%rdx), %r10d
	testl	%r10d, %r10d
	je	.L8
	movl	$1, (%rax)
.L8:
	addq	$4, %rax
	cmpq	%rsi, %rax
	jne	.L9
	addq	$2040, %rdx
	movl	%r9d, %r14d
	movl	$1, %eax
	addq	$4, %rcx
	cmpq	%r8, %rdx
	jne	.L10
.L34:
	testb	%al, %al
	je	.L11
	movl	%r14d, 32(%rsp)
.L11:
	cmpl	$1, %r12d
	jle	.L12
	leaq	0(,%rdi,4), %rdx
	leal	-2(%r12), %ecx
	xorl	%esi, %esi
	salq	$2, %rcx
	leaq	(%r15,%rdx), %rax
	addq	24(%rsp), %rdx
	subq	%rcx, %rdx
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L14:
	movl	1030200(%rax), %edi
	testl	%edi, %edi
	je	.L13
	addl	$1, %esi
	movl	$1, %ecx
.L13:
	subq	$4, %rax
	cmpq	%rax, %rdx
	jne	.L14
	testb	%cl, %cl
	je	.L12
	movl	%esi, 36(%rsp)
.L6:
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	printf@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L12:
	xorl	%esi, %esi
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L17:
	movl	$1, %eax
	movl	$1, %r14d
	jmp	.L7
.L33:
	movq	1040456(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L35
	addq	$1040472, %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
.L35:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.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:

main(n,m,a,b,i){for(;scanf("%d%d",&n,&m),n|m;printf("%d\n",a)){int f[510][510]={0};for(i=m;i--;f[a][b]=f[b][a]=1)scanf("%d%d",&a,&b);for(a=i=0;i<=n;i++)if(f[1][i])for(f[505][i]=b=1;b<=n;b++)f[i][b]?f[505][b]=1:0;for(;--i>1;)f[505][i]?a++:0;}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
main(n,m,a,b,i){for(;scanf("%d%d",&n,&m),n|m;printf("%d\n",a)){int f[510][510]={0};for(i=m;i--;f[a][b]=f[b][a]=1)scanf("%d%d",&a,&b);for(a=i=0;i<=n;i++)if(f[1][i])for(f[505][i]=b=1;b<=n;b++)f[i][b]?f[505][b]=1:0;for(;--i>1;)f[505][i]?a++:0;}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	-1040384(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$64, %rsp
	movl	%edi, -1040420(%rbp)
	movl	%esi, -1040424(%rbp)
	movl	%edx, -1040428(%rbp)
	movl	%ecx, -1040432(%rbp)
	movl	%r8d, -1040436(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L15:
	leaq	-1040416(%rbp), %rax
	movl	$1040400, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	-1040424(%rbp), %eax
	movl	%eax, -1040436(%rbp)
	jmp	.L3
.L4:
	leaq	-1040432(%rbp), %rdx
	leaq	-1040428(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-1040432(%rbp), %edx
	movl	-1040428(%rbp), %ecx
	movslq	%ecx, %rdi
	movslq	%edx, %rsi
	movq	%rsi, %rax
	salq	$8, %rax
	subq	%rsi, %rax
	addq	%rax, %rax
	addq	%rdi, %rax
	movl	$1, -1040416(%rbp,%rax,4)
	movl	-1040428(%rbp), %esi
	movl	-1040432(%rbp), %edi
	movslq	%ecx, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$8, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-1040416(%rbp,%rax,4), %edx
	movslq	%edi, %rdi
	movslq	%esi, %rcx
	movq	%rcx, %rax
	salq	$8, %rax
	subq	%rcx, %rax
	addq	%rax, %rax
	addq	%rdi, %rax
	movl	%edx, -1040416(%rbp,%rax,4)
.L3:
	movl	-1040436(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -1040436(%rbp)
	testl	%eax, %eax
	jne	.L4
	movl	$0, -1040436(%rbp)
	movl	-1040436(%rbp), %eax
	movl	%eax, -1040428(%rbp)
	jmp	.L5
.L11:
	movl	-1040436(%rbp), %eax
	cltq
	addq	$510, %rax
	movl	-1040416(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L6
	movl	$1, -1040432(%rbp)
	movl	-1040432(%rbp), %eax
	movl	-1040436(%rbp), %edx
	movslq	%edx, %rdx
	addq	$257550, %rdx
	movl	%eax, -1040416(%rbp,%rdx,4)
	jmp	.L7
.L10:
	movl	-1040432(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1040436(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$8, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-1040416(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L9
	movl	-1040432(%rbp), %eax
	cltq
	addq	$257550, %rax
	movl	$1, -1040416(%rbp,%rax,4)
.L9:
	movl	-1040432(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -1040432(%rbp)
.L7:
	movl	-1040432(%rbp), %edx
	movl	-1040420(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L10
.L6:
	addl	$1, -1040436(%rbp)
.L5:
	movl	-1040420(%rbp), %eax
	cmpl	%eax, -1040436(%rbp)
	jle	.L11
	jmp	.L12
.L14:
	movl	-1040436(%rbp), %eax
	cltq
	addq	$257550, %rax
	movl	-1040416(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L12
	movl	-1040428(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -1040428(%rbp)
.L12:
	subl	$1, -1040436(%rbp)
	cmpl	$1, -1040436(%rbp)
	jg	.L14
	movl	-1040428(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-1040424(%rbp), %rdx
	leaq	-1040420(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-1040420(%rbp), %edx
	movl	-1040424(%rbp), %eax
	orl	%edx, %eax
	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	-1040384(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$64, %rsp
	movl	%edi, -1040420(%rbp)
	movl	%esi, -1040424(%rbp)
	movl	%edx, -1040428(%rbp)
	movl	%ecx, -1040432(%rbp)
	movl	%r8d, -1040436(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L15:
	leaq	-1040416(%rbp), %rax
	movl	$1040400, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	-1040424(%rbp), %eax
	movl	%eax, -1040436(%rbp)
	jmp	.L3
.L4:
	leaq	-1040432(%rbp), %rdx
	leaq	-1040428(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-1040432(%rbp), %edx
	movl	-1040428(%rbp), %ecx
	movslq	%ecx, %rdi
	movslq	%edx, %rsi
	movq	%rsi, %rax
	salq	$8, %rax
	subq	%rsi, %rax
	addq	%rax, %rax
	addq	%rdi, %rax
	movl	$1, -1040416(%rbp,%rax,4)
	movl	-1040428(%rbp), %esi
	movl	-1040432(%rbp), %edi
	movslq	%ecx, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$8, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-1040416(%rbp,%rax,4), %edx
	movslq	%edi, %rdi
	movslq	%esi, %rcx
	movq	%rcx, %rax
	salq	$8, %rax
	subq	%rcx, %rax
	addq	%rax, %rax
	addq	%rdi, %rax
	movl	%edx, -1040416(%rbp,%rax,4)
.L3:
	movl	-1040436(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -1040436(%rbp)
	testl	%eax, %eax
	jne	.L4
	movl	$0, -1040436(%rbp)
	movl	-1040436(%rbp), %eax
	movl	%eax, -1040428(%rbp)
	jmp	.L5
.L11:
	movl	-1040436(%rbp), %eax
	cltq
	addq	$510, %rax
	movl	-1040416(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L6
	movl	$1, -1040432(%rbp)
	movl	-1040432(%rbp), %eax
	movl	-1040436(%rbp), %edx
	movslq	%edx, %rdx
	addq	$257550, %rdx
	movl	%eax, -1040416(%rbp,%rdx,4)
	jmp	.L7
.L10:
	movl	-1040432(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1040436(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$8, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-1040416(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L9
	movl	-1040432(%rbp), %eax
	cltq
	addq	$257550, %rax
	movl	$1, -1040416(%rbp,%rax,4)
.L9:
	movl	-1040432(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -1040432(%rbp)
.L7:
	movl	-1040432(%rbp), %edx
	movl	-1040420(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L10
.L6:
	addl	$1, -1040436(%rbp)
.L5:
	movl	-1040420(%rbp), %eax
	cmpl	%eax, -1040436(%rbp)
	jle	.L11
	jmp	.L12
.L14:
	movl	-1040436(%rbp), %eax
	cltq
	addq	$257550, %rax
	movl	-1040416(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L12
	movl	-1040428(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -1040428(%rbp)
.L12:
	subl	$1, -1040436(%rbp)
	cmpl	$1, -1040436(%rbp)
	jg	.L14
	movl	-1040428(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-1040424(%rbp), %rdx
	leaq	-1040420(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-1040420(%rbp), %edx
	movl	-1040424(%rbp), %eax
	orl	%edx, %eax
	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:
