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 first[200000],b[200000];
int go[400000],next[400000];
void search(int k){
	int t=first[k];
	while (t!=0){
		int v=go[t];
		if (b[v]==1){
			b[v]=0;
			search(v);
		}
		t=next[t];
	}
}
int main(){
	int n,m;
	int x,y;
	scanf("%d %d",&n,&m);
	for (int i=1;i<=m;i++){
	scanf("%d %d",&x,&y);
    next[i]=first[x];
    first[x]=i;
    go[i]=y;
    next[i+m]=first[y];
    first[y]=i+m;
    go[i+m]=x;
	}
	int count=0;
	for (int i=1;i<=n;i++){
		b[i]=1;
	}
	for (int i=1;i<=n;i++){
		if (b[i]==0) continue;
		count++;
		b[i]=0;
		search(i);
	}
	printf("%d",count-1);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	first
	.bss
	.align 32
	.type	first, @object
	.size	first, 800000
first:
	.zero	800000
	.globl	b
	.align 32
	.type	b, @object
	.size	b, 800000
b:
	.zero	800000
	.globl	go
	.align 32
	.type	go, @object
	.size	go, 1600000
go:
	.zero	1600000
	.globl	next
	.align 32
	.type	next, @object
	.size	next, 1600000
next:
	.zero	1600000
	.text
	.globl	search
	.type	search, @function
search:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	first(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
	jmp	.L2
.L4:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	go(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L3
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	search
.L3:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	next(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
.L2:
	cmpl	$0, -8(%rbp)
	jne	.L4
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	search, .-search
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-36(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -24(%rbp)
	jmp	.L6
.L7:
	leaq	-28(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	first(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	next(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	first(%rip), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-28(%rbp), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	go(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-28(%rbp), %eax
	movl	-36(%rbp), %ecx
	movl	-24(%rbp), %edx
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	first(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%ecx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	next(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-36(%rbp), %ecx
	movl	-28(%rbp), %eax
	movl	-24(%rbp), %edx
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	first(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-36(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%eax, %edx
	movl	-32(%rbp), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	go(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -24(%rbp)
.L6:
	movl	-36(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jle	.L7
	movl	$0, -20(%rbp)
	movl	$1, -16(%rbp)
	jmp	.L8
.L9:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	$1, (%rdx,%rax)
	addl	$1, -16(%rbp)
.L8:
	movl	-40(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L9
	movl	$1, -12(%rbp)
	jmp	.L10
.L13:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L16
	addl	$1, -20(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-12(%rbp), %eax
	movl	%eax, %edi
	call	search
	jmp	.L12
.L16:
	nop
.L12:
	addl	$1, -12(%rbp)
.L10:
	movl	-40(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L13
	movl	-20(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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
	.p2align 4
	.globl	search
	.type	search, @function
search:
.LFB23:
	.cfi_startproc
	endbr64
	leaq	first(%rip), %rcx
	movslq	%edi, %rdi
	movl	(%rcx,%rdi,4), %eax
	testl	%eax, %eax
	je	.L49
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	go(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	next(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	b(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
.L17:
	movslq	%eax, %rbx
	movslq	(%r14,%rbx,4), %rax
	cmpl	$1, (%r12,%rax,4)
	je	.L58
.L3:
	movl	0(%r13,%rbx,4), %eax
	testl	%eax, %eax
	jne	.L17
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
	.p2align 4,,10
	.p2align 3
.L58:
	.cfi_restore_state
	movl	$0, (%r12,%rax,4)
	movl	(%rcx,%rax,4), %eax
	testl	%eax, %eax
	je	.L3
	movslq	%eax, %rbp
	movslq	(%r14,%rbp,4), %rax
	cmpl	$1, (%r12,%rax,4)
	je	.L59
	.p2align 4,,10
	.p2align 3
.L4:
	movl	0(%r13,%rbp,4), %eax
	testl	%eax, %eax
	je	.L3
	movslq	%eax, %rbp
	movslq	(%r14,%rbp,4), %rax
	cmpl	$1, (%r12,%rax,4)
	jne	.L4
.L59:
	movl	$0, (%r12,%rax,4)
	movl	(%rcx,%rax,4), %eax
	testl	%eax, %eax
	je	.L4
	movslq	%eax, %r15
	movslq	(%r14,%r15,4), %rax
	cmpl	$1, (%r12,%rax,4)
	je	.L60
	.p2align 4,,10
	.p2align 3
.L5:
	movl	0(%r13,%r15,4), %eax
	testl	%eax, %eax
	je	.L4
	movslq	%eax, %r15
	movslq	(%r14,%r15,4), %rax
	cmpl	$1, (%r12,%rax,4)
	jne	.L5
.L60:
	movl	$0, (%r12,%rax,4)
	movslq	(%rcx,%rax,4), %rax
	testl	%eax, %eax
	je	.L5
	movslq	(%r14,%rax,4), %rdx
	cmpl	$1, (%r12,%rdx,4)
	je	.L61
	.p2align 4,,10
	.p2align 3
.L6:
	movslq	0(%r13,%rax,4), %rax
	testl	%eax, %eax
	je	.L5
	movslq	(%r14,%rax,4), %rdx
	cmpl	$1, (%r12,%rdx,4)
	jne	.L6
.L61:
	movl	$0, (%r12,%rdx,4)
	movslq	(%rcx,%rdx,4), %rdx
	testl	%edx, %edx
	je	.L6
	movslq	(%r14,%rdx,4), %rsi
	cmpl	$1, (%r12,%rsi,4)
	je	.L62
	.p2align 4,,10
	.p2align 3
.L7:
	movslq	0(%r13,%rdx,4), %rdx
	testl	%edx, %edx
	je	.L6
	movslq	(%r14,%rdx,4), %rsi
	cmpl	$1, (%r12,%rsi,4)
	jne	.L7
.L62:
	movl	$0, (%r12,%rsi,4)
	movslq	(%rcx,%rsi,4), %rsi
	testl	%esi, %esi
	je	.L7
	movslq	(%r14,%rsi,4), %rdi
	cmpl	$1, (%r12,%rdi,4)
	je	.L63
	.p2align 4,,10
	.p2align 3
.L8:
	movslq	0(%r13,%rsi,4), %rsi
	testl	%esi, %esi
	je	.L7
	movslq	(%r14,%rsi,4), %rdi
	cmpl	$1, (%r12,%rdi,4)
	jne	.L8
.L63:
	movl	$0, (%r12,%rdi,4)
	movl	(%rcx,%rdi,4), %edi
	testl	%edi, %edi
	je	.L8
.L11:
	movslq	%edi, %r8
	movslq	(%r14,%r8,4), %r9
	cmpl	$1, (%r12,%r9,4)
	movq	%r9, %rdi
	je	.L64
	movl	0(%r13,%r8,4), %edi
	testl	%edi, %edi
	jne	.L11
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L49:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	.cfi_restore 15
	ret
	.p2align 4,,10
	.p2align 3
.L64:
	.cfi_def_cfa_offset 96
	.cfi_offset 3, -56
	.cfi_offset 6, -48
	.cfi_offset 12, -40
	.cfi_offset 13, -32
	.cfi_offset 14, -24
	.cfi_offset 15, -16
	movq	%rsi, 24(%rsp)
	movq	%rdx, 16(%rsp)
	movq	%rax, 8(%rsp)
	movq	%r8, (%rsp)
	movl	$0, (%r12,%r9,4)
	call	search
	movq	(%rsp), %r8
	movq	8(%rsp), %rax
	leaq	first(%rip), %rcx
	movq	16(%rsp), %rdx
	movq	24(%rsp), %rsi
	movl	0(%r13,%r8,4), %edi
	testl	%edi, %edi
	jne	.L11
	jmp	.L8
	.cfi_endproc
.LFE23:
	.size	search, .-search
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC2:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rbp, %rdi
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rdx
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %edx
	testl	%edx, %edx
	jle	.L69
	leaq	32(%rsp), %rax
	movl	$1, %ebx
	leaq	36(%rsp), %r13
	movq	%rax, (%rsp)
	leaq	next(%rip), %r12
	leaq	first(%rip), %r14
	leaq	go(%rip), %r15
	.p2align 4,,10
	.p2align 3
.L66:
	movq	(%rsp), %rsi
	movq	%r13, %rdx
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	32(%rsp), %rax
	movl	(%r14,%rax,4), %edx
	movq	%rax, %rsi
	movl	%ebx, (%r14,%rax,4)
	movslq	36(%rsp), %rax
	movl	%edx, (%r12,%rbx,4)
	movl	28(%rsp), %edx
	movl	(%r14,%rax,4), %r9d
	movl	%eax, (%r15,%rbx,4)
	leal	(%rdx,%rbx), %edi
	addq	$1, %rbx
	movslq	%edi, %rcx
	movl	%edi, (%r14,%rax,4)
	movl	%r9d, (%r12,%rcx,4)
	movl	%esi, (%r15,%rcx,4)
	cmpl	%ebx, %edx
	jge	.L66
.L69:
	movl	24(%rsp), %esi
	xorl	%edx, %edx
	testl	%esi, %esi
	jle	.L68
	leal	-1(%rsi), %eax
	cmpl	$2, %eax
	jbe	.L93
	movl	%esi, %edx
	leaq	4+b(%rip), %rax
	movdqa	.LC1(%rip), %xmm0
	shrl	$2, %edx
	leaq	16(%rax), %rcx
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rcx, %rdx
	.p2align 4,,10
	.p2align 3
.L71:
	movups	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rax, %rdx
	jne	.L71
	movl	%esi, %edx
	leaq	b(%rip), %rbx
	andl	$-4, %edx
	leal	1(%rdx), %eax
	cmpl	%edx, %esi
	je	.L72
.L70:
	movslq	%eax, %rdx
	leaq	b(%rip), %rbx
	movl	$1, (%rbx,%rdx,4)
	leal	1(%rax), %edx
	cmpl	%esi, %edx
	jg	.L72
	movslq	%edx, %rdx
	addl	$2, %eax
	movl	$1, (%rbx,%rdx,4)
	cmpl	%esi, %eax
	jg	.L72
	cltq
	movl	$1, (%rbx,%rax,4)
.L72:
	movl	$1, %r14d
	xorl	%edx, %edx
	leaq	first(%rip), %rcx
	leaq	next(%rip), %r13
	leaq	go(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L90:
	movl	(%rbx,%r14,4), %eax
	testl	%eax, %eax
	je	.L73
	movl	(%rcx,%r14,4), %eax
	movl	$0, (%rbx,%r14,4)
	addl	$1, %edx
	testl	%eax, %eax
	je	.L73
.L74:
	movslq	%eax, %r10
	movslq	(%r12,%r10,4), %rax
	cmpl	$1, (%rbx,%rax,4)
	je	.L75
.L77:
	movl	0(%r13,%r10,4), %eax
	testl	%eax, %eax
	jne	.L74
	movl	24(%rsp), %esi
.L73:
	addq	$1, %r14
	cmpl	%r14d, %esi
	jge	.L90
.L68:
	subl	$1, %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L125
	addq	$56, %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
	.p2align 4,,10
	.p2align 3
.L75:
	.cfi_restore_state
	movl	$0, (%rbx,%rax,4)
	movl	(%rcx,%rax,4), %eax
	testl	%eax, %eax
	je	.L77
	movslq	%eax, %r11
	movslq	(%r12,%r11,4), %rax
	cmpl	$1, (%rbx,%rax,4)
	je	.L78
	.p2align 4,,10
	.p2align 3
.L80:
	movl	0(%r13,%r11,4), %eax
	testl	%eax, %eax
	je	.L77
	movslq	%eax, %r11
	movslq	(%r12,%r11,4), %rax
	cmpl	$1, (%rbx,%rax,4)
	jne	.L80
.L78:
	movl	$0, (%rbx,%rax,4)
	movl	(%rcx,%rax,4), %eax
	testl	%eax, %eax
	je	.L80
	movslq	%eax, %rbp
	movslq	(%r12,%rbp,4), %rax
	cmpl	$1, (%rbx,%rax,4)
	je	.L81
	.p2align 4,,10
	.p2align 3
.L83:
	movl	0(%r13,%rbp,4), %eax
	testl	%eax, %eax
	je	.L80
	movslq	%eax, %rbp
	movslq	(%r12,%rbp,4), %rax
	cmpl	$1, (%rbx,%rax,4)
	jne	.L83
.L81:
	movl	$0, (%rbx,%rax,4)
	movl	(%rcx,%rax,4), %eax
	testl	%eax, %eax
	je	.L83
	movslq	%eax, %r15
	movslq	(%r12,%r15,4), %rax
	cmpl	$1, (%rbx,%rax,4)
	je	.L84
	.p2align 4,,10
	.p2align 3
.L86:
	movl	0(%r13,%r15,4), %eax
	testl	%eax, %eax
	je	.L83
	movslq	%eax, %r15
	movslq	(%r12,%r15,4), %rax
	cmpl	$1, (%rbx,%rax,4)
	jne	.L86
.L84:
	movl	$0, (%rbx,%rax,4)
	movslq	(%rcx,%rax,4), %rax
	testl	%eax, %eax
	je	.L86
.L89:
	movslq	(%r12,%rax,4), %rsi
	cmpl	$1, (%rbx,%rsi,4)
	movq	%rsi, %rdi
	je	.L126
.L87:
	movslq	0(%r13,%rax,4), %rax
	testl	%eax, %eax
	je	.L86
	movslq	(%r12,%rax,4), %rsi
	cmpl	$1, (%rbx,%rsi,4)
	movq	%rsi, %rdi
	jne	.L87
.L126:
	movl	$0, (%rbx,%rsi,4)
	movq	%rax, 8(%rsp)
	movl	%edx, (%rsp)
	call	search
	movq	8(%rsp), %rax
	movl	(%rsp), %edx
	leaq	first(%rip), %rcx
	movslq	0(%r13,%rax,4), %rax
	testl	%eax, %eax
	jne	.L89
	jmp	.L86
.L93:
	movl	$1, %eax
	jmp	.L70
.L125:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	next
	.bss
	.align 32
	.type	next, @object
	.size	next, 1600000
next:
	.zero	1600000
	.globl	go
	.align 32
	.type	go, @object
	.size	go, 1600000
go:
	.zero	1600000
	.globl	b
	.align 32
	.type	b, @object
	.size	b, 800000
b:
	.zero	800000
	.globl	first
	.align 32
	.type	first, @object
	.size	first, 800000
first:
	.zero	800000
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	1
	.long	1
	.long	1
	.long	1
	.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
	.p2align 4
	.globl	search
	.type	search, @function
search:
.LFB23:
	.cfi_startproc
	endbr64
	leaq	first(%rip), %rcx
	movslq	%edi, %rdi
	movl	(%rcx,%rdi,4), %eax
	testl	%eax, %eax
	je	.L49
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	go(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	next(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	b(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
.L17:
	movslq	%eax, %rbx
	movslq	(%r14,%rbx,4), %rax
	cmpl	$1, (%r12,%rax,4)
	je	.L58
.L3:
	movl	0(%r13,%rbx,4), %eax
	testl	%eax, %eax
	jne	.L17
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
	.p2align 4,,10
	.p2align 3
.L58:
	.cfi_restore_state
	movl	$0, (%r12,%rax,4)
	movl	(%rcx,%rax,4), %eax
	testl	%eax, %eax
	je	.L3
	movslq	%eax, %rbp
	movslq	(%r14,%rbp,4), %rax
	cmpl	$1, (%r12,%rax,4)
	je	.L59
	.p2align 4,,10
	.p2align 3
.L4:
	movl	0(%r13,%rbp,4), %eax
	testl	%eax, %eax
	je	.L3
	movslq	%eax, %rbp
	movslq	(%r14,%rbp,4), %rax
	cmpl	$1, (%r12,%rax,4)
	jne	.L4
.L59:
	movl	$0, (%r12,%rax,4)
	movl	(%rcx,%rax,4), %eax
	testl	%eax, %eax
	je	.L4
	movslq	%eax, %r15
	movslq	(%r14,%r15,4), %rax
	cmpl	$1, (%r12,%rax,4)
	je	.L60
	.p2align 4,,10
	.p2align 3
.L5:
	movl	0(%r13,%r15,4), %eax
	testl	%eax, %eax
	je	.L4
	movslq	%eax, %r15
	movslq	(%r14,%r15,4), %rax
	cmpl	$1, (%r12,%rax,4)
	jne	.L5
.L60:
	movl	$0, (%r12,%rax,4)
	movslq	(%rcx,%rax,4), %rax
	testl	%eax, %eax
	je	.L5
	movslq	(%r14,%rax,4), %rdx
	cmpl	$1, (%r12,%rdx,4)
	je	.L61
	.p2align 4,,10
	.p2align 3
.L6:
	movslq	0(%r13,%rax,4), %rax
	testl	%eax, %eax
	je	.L5
	movslq	(%r14,%rax,4), %rdx
	cmpl	$1, (%r12,%rdx,4)
	jne	.L6
.L61:
	movl	$0, (%r12,%rdx,4)
	movslq	(%rcx,%rdx,4), %rdx
	testl	%edx, %edx
	je	.L6
	movslq	(%r14,%rdx,4), %rsi
	cmpl	$1, (%r12,%rsi,4)
	je	.L62
	.p2align 4,,10
	.p2align 3
.L7:
	movslq	0(%r13,%rdx,4), %rdx
	testl	%edx, %edx
	je	.L6
	movslq	(%r14,%rdx,4), %rsi
	cmpl	$1, (%r12,%rsi,4)
	jne	.L7
.L62:
	movl	$0, (%r12,%rsi,4)
	movslq	(%rcx,%rsi,4), %rsi
	testl	%esi, %esi
	je	.L7
	movslq	(%r14,%rsi,4), %rdi
	cmpl	$1, (%r12,%rdi,4)
	je	.L63
	.p2align 4,,10
	.p2align 3
.L8:
	movslq	0(%r13,%rsi,4), %rsi
	testl	%esi, %esi
	je	.L7
	movslq	(%r14,%rsi,4), %rdi
	cmpl	$1, (%r12,%rdi,4)
	jne	.L8
.L63:
	movl	$0, (%r12,%rdi,4)
	movl	(%rcx,%rdi,4), %edi
	testl	%edi, %edi
	je	.L8
.L11:
	movslq	%edi, %r8
	movslq	(%r14,%r8,4), %r9
	cmpl	$1, (%r12,%r9,4)
	movq	%r9, %rdi
	je	.L64
	movl	0(%r13,%r8,4), %edi
	testl	%edi, %edi
	jne	.L11
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L49:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	.cfi_restore 15
	ret
	.p2align 4,,10
	.p2align 3
.L64:
	.cfi_def_cfa_offset 96
	.cfi_offset 3, -56
	.cfi_offset 6, -48
	.cfi_offset 12, -40
	.cfi_offset 13, -32
	.cfi_offset 14, -24
	.cfi_offset 15, -16
	movq	%rsi, 24(%rsp)
	movq	%rdx, 16(%rsp)
	movq	%rax, 8(%rsp)
	movq	%r8, (%rsp)
	movl	$0, (%r12,%r9,4)
	call	search
	movq	(%rsp), %r8
	movq	8(%rsp), %rax
	leaq	first(%rip), %rcx
	movq	16(%rsp), %rdx
	movq	24(%rsp), %rsi
	movl	0(%r13,%r8,4), %edi
	testl	%edi, %edi
	jne	.L11
	jmp	.L8
	.cfi_endproc
.LFE23:
	.size	search, .-search
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC2:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rbp, %rdi
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rdx
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %edx
	testl	%edx, %edx
	jle	.L69
	leaq	32(%rsp), %rax
	movl	$1, %ebx
	leaq	36(%rsp), %r13
	movq	%rax, (%rsp)
	leaq	next(%rip), %r12
	leaq	first(%rip), %r14
	leaq	go(%rip), %r15
	.p2align 4,,10
	.p2align 3
.L66:
	movq	(%rsp), %rsi
	movq	%r13, %rdx
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	32(%rsp), %rax
	movl	(%r14,%rax,4), %edx
	movq	%rax, %rsi
	movl	%ebx, (%r14,%rax,4)
	movslq	36(%rsp), %rax
	movl	%edx, (%r12,%rbx,4)
	movl	28(%rsp), %edx
	movl	(%r14,%rax,4), %r9d
	movl	%eax, (%r15,%rbx,4)
	leal	(%rdx,%rbx), %edi
	addq	$1, %rbx
	movslq	%edi, %rcx
	movl	%edi, (%r14,%rax,4)
	movl	%r9d, (%r12,%rcx,4)
	movl	%esi, (%r15,%rcx,4)
	cmpl	%ebx, %edx
	jge	.L66
.L69:
	movl	24(%rsp), %esi
	xorl	%edx, %edx
	testl	%esi, %esi
	jle	.L68
	leal	-1(%rsi), %eax
	cmpl	$2, %eax
	jbe	.L93
	movl	%esi, %edx
	leaq	4+b(%rip), %rax
	movdqa	.LC1(%rip), %xmm0
	shrl	$2, %edx
	leaq	16(%rax), %rcx
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rcx, %rdx
	.p2align 4,,10
	.p2align 3
.L71:
	movups	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rax, %rdx
	jne	.L71
	movl	%esi, %edx
	leaq	b(%rip), %rbx
	andl	$-4, %edx
	leal	1(%rdx), %eax
	cmpl	%edx, %esi
	je	.L72
.L70:
	movslq	%eax, %rdx
	leaq	b(%rip), %rbx
	movl	$1, (%rbx,%rdx,4)
	leal	1(%rax), %edx
	cmpl	%esi, %edx
	jg	.L72
	movslq	%edx, %rdx
	addl	$2, %eax
	movl	$1, (%rbx,%rdx,4)
	cmpl	%esi, %eax
	jg	.L72
	cltq
	movl	$1, (%rbx,%rax,4)
.L72:
	movl	$1, %r14d
	xorl	%edx, %edx
	leaq	first(%rip), %rcx
	leaq	next(%rip), %r13
	leaq	go(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L90:
	movl	(%rbx,%r14,4), %eax
	testl	%eax, %eax
	je	.L73
	movl	(%rcx,%r14,4), %eax
	movl	$0, (%rbx,%r14,4)
	addl	$1, %edx
	testl	%eax, %eax
	je	.L73
.L74:
	movslq	%eax, %r10
	movslq	(%r12,%r10,4), %rax
	cmpl	$1, (%rbx,%rax,4)
	je	.L75
.L77:
	movl	0(%r13,%r10,4), %eax
	testl	%eax, %eax
	jne	.L74
	movl	24(%rsp), %esi
.L73:
	addq	$1, %r14
	cmpl	%r14d, %esi
	jge	.L90
.L68:
	subl	$1, %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L125
	addq	$56, %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
	.p2align 4,,10
	.p2align 3
.L75:
	.cfi_restore_state
	movl	$0, (%rbx,%rax,4)
	movl	(%rcx,%rax,4), %eax
	testl	%eax, %eax
	je	.L77
	movslq	%eax, %r11
	movslq	(%r12,%r11,4), %rax
	cmpl	$1, (%rbx,%rax,4)
	je	.L78
	.p2align 4,,10
	.p2align 3
.L80:
	movl	0(%r13,%r11,4), %eax
	testl	%eax, %eax
	je	.L77
	movslq	%eax, %r11
	movslq	(%r12,%r11,4), %rax
	cmpl	$1, (%rbx,%rax,4)
	jne	.L80
.L78:
	movl	$0, (%rbx,%rax,4)
	movl	(%rcx,%rax,4), %eax
	testl	%eax, %eax
	je	.L80
	movslq	%eax, %rbp
	movslq	(%r12,%rbp,4), %rax
	cmpl	$1, (%rbx,%rax,4)
	je	.L81
	.p2align 4,,10
	.p2align 3
.L83:
	movl	0(%r13,%rbp,4), %eax
	testl	%eax, %eax
	je	.L80
	movslq	%eax, %rbp
	movslq	(%r12,%rbp,4), %rax
	cmpl	$1, (%rbx,%rax,4)
	jne	.L83
.L81:
	movl	$0, (%rbx,%rax,4)
	movl	(%rcx,%rax,4), %eax
	testl	%eax, %eax
	je	.L83
	movslq	%eax, %r15
	movslq	(%r12,%r15,4), %rax
	cmpl	$1, (%rbx,%rax,4)
	je	.L84
	.p2align 4,,10
	.p2align 3
.L86:
	movl	0(%r13,%r15,4), %eax
	testl	%eax, %eax
	je	.L83
	movslq	%eax, %r15
	movslq	(%r12,%r15,4), %rax
	cmpl	$1, (%rbx,%rax,4)
	jne	.L86
.L84:
	movl	$0, (%rbx,%rax,4)
	movslq	(%rcx,%rax,4), %rax
	testl	%eax, %eax
	je	.L86
.L89:
	movslq	(%r12,%rax,4), %rsi
	cmpl	$1, (%rbx,%rsi,4)
	movq	%rsi, %rdi
	je	.L126
.L87:
	movslq	0(%r13,%rax,4), %rax
	testl	%eax, %eax
	je	.L86
	movslq	(%r12,%rax,4), %rsi
	cmpl	$1, (%rbx,%rsi,4)
	movq	%rsi, %rdi
	jne	.L87
.L126:
	movl	$0, (%rbx,%rsi,4)
	movq	%rax, 8(%rsp)
	movl	%edx, (%rsp)
	call	search
	movq	8(%rsp), %rax
	movl	(%rsp), %edx
	leaq	first(%rip), %rcx
	movslq	0(%r13,%rax,4), %rax
	testl	%eax, %eax
	jne	.L89
	jmp	.L86
.L93:
	movl	$1, %eax
	jmp	.L70
.L125:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	next
	.bss
	.align 32
	.type	next, @object
	.size	next, 1600000
next:
	.zero	1600000
	.globl	go
	.align 32
	.type	go, @object
	.size	go, 1600000
go:
	.zero	1600000
	.globl	b
	.align 32
	.type	b, @object
	.size	b, 800000
b:
	.zero	800000
	.globl	first
	.align 32
	.type	first, @object
	.size	first, 800000
first:
	.zero	800000
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	1
	.long	1
	.long	1
	.long	1
	.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 first[200000],b[200000];
int go[400000],next[400000];
void search(int k){
	int t=first[k];
	while (t!=0){
		int v=go[t];
		if (b[v]==1){
			b[v]=0;
			search(v);
		}
		t=next[t];
	}
}
int main(){
	int n,m;
	int x,y;
	scanf("%d %d",&n,&m);
	for (int i=1;i<=m;i++){
	scanf("%d %d",&x,&y);
    next[i]=first[x];
    first[x]=i;
    go[i]=y;
    next[i+m]=first[y];
    first[y]=i+m;
    go[i+m]=x;
	}
	int count=0;
	for (int i=1;i<=n;i++){
		b[i]=1;
	}
	for (int i=1;i<=n;i++){
		if (b[i]==0) continue;
		count++;
		b[i]=0;
		search(i);
	}
	printf("%d",count-1);
}
3 1
1 1
 5 1
1 1
 6 1
1 1
 3 1
3 2
 5 1
3 2
 2 1
1 2
 9 1
1 2
 15 1
1 2
 10 1
1 2
 10 1
1 1

2 4 5 1 3 0 7 13 8 9
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 first[200000],b[200000];
int go[400000],next[400000];
void search(int k){
	int t=first[k];
	while (t!=0){
		int v=go[t];
		if (b[v]==1){
			b[v]=0;
			search(v);
		}
		t=next[t];
	}
}
int main(){
	int n,m;
	int x,y;
	scanf("%d %d",&n,&m);
	for (int i=1;i<=m;i++){
	scanf("%d %d",&x,&y);
    next[i]=first[x];
    first[x]=i;
    go[i]=y;
    next[i+m]=first[y];
    first[y]=i+m;
    go[i+m]=x;
	}
	int count=0;
	for (int i=1;i<=n;i++){
		b[i]=1;
	}
	for (int i=1;i<=n;i++){
		if (b[i]==0) continue;
		count++;
		b[i]=0;
		search(i);
	}
	printf("%d",count-1);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	first
	.bss
	.align 32
	.type	first, @object
	.size	first, 800000
first:
	.zero	800000
	.globl	b
	.align 32
	.type	b, @object
	.size	b, 800000
b:
	.zero	800000
	.globl	go
	.align 32
	.type	go, @object
	.size	go, 1600000
go:
	.zero	1600000
	.globl	next
	.align 32
	.type	next, @object
	.size	next, 1600000
next:
	.zero	1600000
	.text
	.globl	search
	.type	search, @function
search:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	first(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
	jmp	.L2
.L4:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	go(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L3
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	search
.L3:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	next(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
.L2:
	cmpl	$0, -8(%rbp)
	jne	.L4
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	search, .-search
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-36(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -24(%rbp)
	jmp	.L6
.L7:
	leaq	-28(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	first(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	next(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	first(%rip), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-28(%rbp), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	go(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-28(%rbp), %eax
	movl	-36(%rbp), %ecx
	movl	-24(%rbp), %edx
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	first(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%ecx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	next(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-36(%rbp), %ecx
	movl	-28(%rbp), %eax
	movl	-24(%rbp), %edx
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	first(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-36(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%eax, %edx
	movl	-32(%rbp), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	go(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -24(%rbp)
.L6:
	movl	-36(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jle	.L7
	movl	$0, -20(%rbp)
	movl	$1, -16(%rbp)
	jmp	.L8
.L9:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	$1, (%rdx,%rax)
	addl	$1, -16(%rbp)
.L8:
	movl	-40(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L9
	movl	$1, -12(%rbp)
	jmp	.L10
.L13:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L16
	addl	$1, -20(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-12(%rbp), %eax
	movl	%eax, %edi
	call	search
	jmp	.L12
.L16:
	nop
.L12:
	addl	$1, -12(%rbp)
.L10:
	movl	-40(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L13
	movl	-20(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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
	.globl	first
	.bss
	.align 32
	.type	first, @object
	.size	first, 800000
first:
	.zero	800000
	.globl	b
	.align 32
	.type	b, @object
	.size	b, 800000
b:
	.zero	800000
	.globl	go
	.align 32
	.type	go, @object
	.size	go, 1600000
go:
	.zero	1600000
	.globl	next
	.align 32
	.type	next, @object
	.size	next, 1600000
next:
	.zero	1600000
	.text
	.globl	search
	.type	search, @function
search:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	first(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
	jmp	.L2
.L4:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	go(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L3
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	search
.L3:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	next(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
.L2:
	cmpl	$0, -8(%rbp)
	jne	.L4
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	search, .-search
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-36(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -24(%rbp)
	jmp	.L6
.L7:
	leaq	-28(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	first(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	next(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	first(%rip), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-28(%rbp), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	go(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-28(%rbp), %eax
	movl	-36(%rbp), %ecx
	movl	-24(%rbp), %edx
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	first(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%ecx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	next(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-36(%rbp), %ecx
	movl	-28(%rbp), %eax
	movl	-24(%rbp), %edx
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	first(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-36(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%eax, %edx
	movl	-32(%rbp), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	go(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -24(%rbp)
.L6:
	movl	-36(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jle	.L7
	movl	$0, -20(%rbp)
	movl	$1, -16(%rbp)
	jmp	.L8
.L9:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	$1, (%rdx,%rax)
	addl	$1, -16(%rbp)
.L8:
	movl	-40(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L9
	movl	$1, -12(%rbp)
	jmp	.L10
.L13:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L16
	addl	$1, -20(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-12(%rbp), %eax
	movl	%eax, %edi
	call	search
	jmp	.L12
.L16:
	nop
.L12:
	addl	$1, -12(%rbp)
.L10:
	movl	-40(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L13
	movl	-20(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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:
