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 p[200010];
int d[200010]={};
int S[200010];
int Top(int a){
  for(;p[a]-a;a=p[a]);
  return a;
}
int Find(int a,int b){
  int n,r;
  for(r=Top(a);p[a]!=a;a=n){
    n=p[a];
    p[a]=r;
  }
  for(r=Top(b);p[b]!=b;b=n){
    n=p[b];
    p[b]=r;
  }
  return a-b?1:0;
}
void Union(int a,int b){
  if(Find(a,b)){
    a=Top(a);
    b=Top(b);
    d[a]<d[b]?(p[a]=b):(p[b]=a);
    if(d[a]==d[b])d[a]++;
    S[a]=S[b]=S[a]+S[b];
  }
}
int main(){
  int i,n,m,a,b;
  scanf("%d %d",&n,&m);
  for(i=0;i<=n;i++)p[i]=i;
  for(i=0;i<=n;i++)S[i]=1;
  while(m--){
    scanf("%d %d",&a,&b);
    Union(a,b);
  }
  for(i=0;i<n;i++){
    if(m<S[i+1])m=S[i+1];
  }
  printf("%d\n",m);
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	p
	.bss
	.align 32
	.type	p, @object
	.size	p, 800040
p:
	.zero	800040
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 800040
d:
	.zero	800040
	.globl	S
	.align 32
	.type	S, @object
	.size	S, 800040
S:
	.zero	800040
	.text
	.globl	Top
	.type	Top, @function
Top:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	jmp	.L2
.L3:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	jne	.L3
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	Top, .-Top
	.globl	Find
	.type	Find, @function
Find:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$24, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	Top
	movl	%eax, -8(%rbp)
	jmp	.L6
.L7:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	movl	%eax, -20(%rbp)
.L6:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -20(%rbp)
	jne	.L7
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	call	Top
	movl	%eax, -8(%rbp)
	jmp	.L8
.L9:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	movl	%eax, -24(%rbp)
.L8:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -24(%rbp)
	jne	.L9
	movl	-20(%rbp), %eax
	cmpl	-24(%rbp), %eax
	setne	%al
	movzbl	%al, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	Find, .-Find
	.globl	Union
	.type	Union, @function
Union:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$8, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	Find
	testl	%eax, %eax
	je	.L16
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	Top
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, %edi
	call	Top
	movl	%eax, -8(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	d(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L13
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L14
.L13:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L14:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	d(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jne	.L15
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L15:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	S(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L16:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	Union, .-Union
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.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
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-24(%rbp), %rdx
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L18
.L19:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	addl	$1, -12(%rbp)
.L18:
	movl	-28(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L19
	movl	$0, -12(%rbp)
	jmp	.L20
.L21:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	movl	$1, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L20:
	movl	-28(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L21
	jmp	.L22
.L23:
	leaq	-16(%rbp), %rdx
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-16(%rbp), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	Union
.L22:
	movl	-24(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -24(%rbp)
	testl	%eax, %eax
	jne	.L23
	movl	$0, -12(%rbp)
	jmp	.L24
.L26:
	movl	-12(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L25
	movl	-12(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
.L25:
	addl	$1, -12(%rbp)
.L24:
	movl	-28(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L26
	movl	-24(%rbp), %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	.L28
	call	__stack_chk_fail@PLT
.L28:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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	Top
	.type	Top, @function
Top:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	leaq	p(%rip), %rcx
	.p2align 4,,10
	.p2align 3
.L2:
	cltq
	movq	%rax, %rdx
	movl	(%rcx,%rax,4), %eax
	cmpl	%edx, %eax
	jne	.L2
	ret
	.cfi_endproc
.LFE23:
	.size	Top, .-Top
	.p2align 4
	.globl	Find
	.type	Find, @function
Find:
.LFB24:
	.cfi_startproc
	endbr64
	movl	%esi, %r8d
	movl	%edi, %ecx
	leaq	p(%rip), %rax
	.p2align 4,,10
	.p2align 3
.L6:
	movslq	%ecx, %rcx
	movq	%rcx, %rdx
	movl	(%rax,%rcx,4), %ecx
	cmpl	%edx, %ecx
	jne	.L6
	movslq	%edi, %rsi
	movl	(%rax,%rsi,4), %ecx
	cmpl	%ecx, %edi
	jne	.L8
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%esi, %ecx
	movslq	%edi, %rsi
.L8:
	movl	%edx, (%rax,%rsi,4)
	movslq	%ecx, %rsi
	movl	%ecx, %edi
	movl	(%rax,%rsi,4), %esi
	cmpl	%ecx, %esi
	jne	.L12
.L7:
	movl	%r8d, %esi
	.p2align 4,,10
	.p2align 3
.L9:
	movslq	%esi, %rsi
	movq	%rsi, %rdx
	movl	(%rax,%rsi,4), %esi
	cmpl	%esi, %edx
	jne	.L9
	movslq	%r8d, %rdi
	movl	(%rax,%rdi,4), %esi
	cmpl	%esi, %r8d
	jne	.L11
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%edi, %esi
	movslq	%r8d, %rdi
.L11:
	movl	%edx, (%rax,%rdi,4)
	movslq	%esi, %rdi
	movl	%esi, %r8d
	movl	(%rax,%rdi,4), %edi
	cmpl	%esi, %edi
	jne	.L13
.L10:
	xorl	%eax, %eax
	cmpl	%ecx, %esi
	setne	%al
	ret
	.cfi_endproc
.LFE24:
	.size	Find, .-Find
	.p2align 4
	.globl	Union
	.type	Union, @function
Union:
.LFB25:
	.cfi_startproc
	endbr64
	movl	%edi, %r9d
	movl	%esi, %r8d
	leaq	p(%rip), %rax
	movl	%edi, %ecx
	.p2align 4,,10
	.p2align 3
.L17:
	movslq	%ecx, %rcx
	movq	%rcx, %rdx
	movl	(%rax,%rcx,4), %ecx
	cmpl	%ecx, %edx
	jne	.L17
	movslq	%r9d, %r10
	movl	(%rax,%r10,4), %esi
	cmpl	%esi, %r9d
	je	.L28
	movslq	%r9d, %rcx
	.p2align 4,,10
	.p2align 3
.L19:
	movl	%edx, (%rax,%rcx,4)
	movslq	%esi, %rcx
	movslq	%ecx, %rsi
	movl	(%rax,%rsi,4), %esi
	cmpl	%ecx, %esi
	jne	.L19
.L18:
	movl	%r8d, %edx
	.p2align 4,,10
	.p2align 3
.L20:
	movslq	%edx, %rdx
	movq	%rdx, %rsi
	movl	(%rax,%rdx,4), %edx
	cmpl	%edx, %esi
	jne	.L20
	movslq	%r8d, %r11
	movl	(%rax,%r11,4), %edi
	cmpl	%edi, %r8d
	je	.L29
	movslq	%r8d, %rdx
	.p2align 4,,10
	.p2align 3
.L22:
	movl	%esi, (%rax,%rdx,4)
	movslq	%edi, %rdx
	movslq	%edx, %rdi
	movl	(%rax,%rdi,4), %edi
	cmpl	%edx, %edi
	jne	.L22
	cmpl	%edx, %ecx
	jne	.L24
.L16:
	ret
	.p2align 4,,10
	.p2align 3
.L38:
	movslq	%r9d, %r10
.L24:
	movl	%r9d, %ecx
	movl	(%rax,%r10,4), %r9d
	cmpl	%r9d, %ecx
	jne	.L38
	movslq	%r8d, %rdx
	movl	(%rax,%r11,4), %r8d
	cmpl	%r8d, %edx
	je	.L36
	.p2align 4,,10
	.p2align 3
.L39:
	movslq	%r8d, %r11
	movslq	%r8d, %rdx
	movl	(%rax,%r11,4), %r8d
	cmpl	%r8d, %edx
	jne	.L39
.L36:
	leaq	d(%rip), %rdi
	movslq	%ecx, %rsi
	movl	(%rdi,%rsi,4), %r9d
	cmpl	(%rdi,%r11,4), %r9d
	jge	.L26
	movl	%r8d, (%rax,%rsi,4)
.L27:
	leaq	S(%rip), %rax
	movl	(%rax,%rdx,4), %ecx
	addl	(%rax,%rsi,4), %ecx
	movl	%ecx, (%rax,%rdx,4)
	movl	%ecx, (%rax,%rsi,4)
	ret
	.p2align 4,,10
	.p2align 3
.L26:
	movl	%ecx, (%rax,%r11,4)
	jne	.L27
	addl	$1, %r9d
	movl	%r9d, (%rdi,%rsi,4)
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L28:
	movl	%r9d, %ecx
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L29:
	movl	%r8d, %edx
	cmpl	%edx, %ecx
	je	.L16
	jmp	.L24
	.cfi_endproc
.LFE25:
	.size	Union, .-Union
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d %d"
.LC4:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB26:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	.LC1(%rip), %rbx
	movq	%rbx, %rdi
	subq	$32, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %ecx
	testl	%ecx, %ecx
	js	.L51
	leal	1(%rcx), %esi
	cmpl	$2, %ecx
	jle	.L44
	movl	%esi, %edx
	leaq	p(%rip), %rdi
	movdqa	.LC0(%rip), %xmm0
	movdqa	.LC2(%rip), %xmm2
	shrl	$2, %edx
	leaq	16(%rdi), %r8
	movq	%rdi, %rax
	subl	$1, %edx
	salq	$4, %rdx
	addq	%r8, %rdx
	.p2align 4,,10
	.p2align 3
.L45:
	movdqa	%xmm0, %xmm1
	addq	$16, %rax
	paddd	%xmm2, %xmm0
	movaps	%xmm1, -16(%rax)
	cmpq	%rdx, %rax
	jne	.L45
	movl	%esi, %eax
	andl	$-4, %eax
	testb	$3, %sil
	je	.L46
	movslq	%eax, %rdx
	movl	%eax, (%rdi,%rdx,4)
	addl	$1, %eax
	cmpl	%eax, %ecx
	jl	.L46
.L58:
	movslq	%eax, %rdx
	movl	%eax, (%rdi,%rdx,4)
	addl	$1, %eax
	cmpl	%ecx, %eax
	jg	.L48
	movslq	%eax, %rdx
	movl	%eax, (%rdi,%rdx,4)
.L48:
	cmpl	$2, %ecx
	jle	.L75
.L46:
	movl	%esi, %edx
	leaq	S(%rip), %rdi
	movdqa	.LC3(%rip), %xmm0
	shrl	$2, %edx
	leaq	16(%rdi), %r8
	movq	%rdi, %rax
	subl	$1, %edx
	salq	$4, %rdx
	addq	%r8, %rdx
	.p2align 4,,10
	.p2align 3
.L49:
	movaps	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L49
	movl	%esi, %eax
	andl	$-4, %eax
	andl	$3, %esi
	je	.L51
.L59:
	movslq	%eax, %rdx
	addl	$1, %eax
	movl	$1, (%rdi,%rdx,4)
	cmpl	%eax, %ecx
	jl	.L51
.L56:
	movslq	%eax, %rdx
	addl	$1, %eax
	movl	$1, (%rdi,%rdx,4)
	cmpl	%eax, %ecx
	jl	.L51
	cltq
	movl	$1, (%rdi,%rax,4)
.L51:
	movl	12(%rsp), %edx
	leaq	20(%rsp), %r12
	leaq	16(%rsp), %rbp
	movl	%edx, %eax
	subl	$1, %edx
	movl	%edx, 12(%rsp)
	testl	%eax, %eax
	je	.L43
	.p2align 4,,10
	.p2align 3
.L42:
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %esi
	movl	16(%rsp), %edi
	call	Union
	movl	12(%rsp), %edx
	movl	%edx, %eax
	subl	$1, %edx
	movl	%edx, 12(%rsp)
	testl	%eax, %eax
	jne	.L42
	movl	8(%rsp), %ecx
.L43:
	testl	%ecx, %ecx
	jle	.L53
	leaq	4+S(%rip), %rax
	leal	-1(%rcx), %esi
	xorl	%r8d, %r8d
	leaq	4(%rax), %rcx
	leaq	(%rcx,%rsi,4), %rdi
	movl	$-1, %esi
	.p2align 4,,10
	.p2align 3
.L55:
	movl	(%rax), %ecx
	cmpl	%esi, %ecx
	jle	.L54
	movl	%ecx, %esi
	movl	$1, %r8d
.L54:
	addq	$4, %rax
	cmpq	%rax, %rdi
	jne	.L55
	testb	%r8b, %r8b
	je	.L53
	movl	%esi, 12(%rsp)
	movl	%esi, %edx
.L53:
	xorl	%eax, %eax
	leaq	.LC4(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L76
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L44:
	.cfi_restore_state
	movl	$0, p(%rip)
	movl	$1, %eax
	leaq	p(%rip), %rdi
	testl	%ecx, %ecx
	jne	.L58
	xorl	%eax, %eax
	leaq	S(%rip), %rdi
	jmp	.L59
.L75:
	movl	$1, S(%rip)
	movl	$1, %eax
	leaq	S(%rip), %rdi
	jmp	.L56
.L76:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE26:
	.size	main, .-main
	.globl	S
	.bss
	.align 32
	.type	S, @object
	.size	S, 800040
S:
	.zero	800040
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 800040
d:
	.zero	800040
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 800040
p:
	.zero	800040
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC2:
	.long	4
	.long	4
	.long	4
	.long	4
	.align 16
.LC3:
	.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	Top
	.type	Top, @function
Top:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	leaq	p(%rip), %rcx
	.p2align 4,,10
	.p2align 3
.L2:
	cltq
	movq	%rax, %rdx
	movl	(%rcx,%rax,4), %eax
	cmpl	%edx, %eax
	jne	.L2
	ret
	.cfi_endproc
.LFE23:
	.size	Top, .-Top
	.p2align 4
	.globl	Find
	.type	Find, @function
Find:
.LFB24:
	.cfi_startproc
	endbr64
	movl	%esi, %r8d
	movl	%edi, %ecx
	leaq	p(%rip), %rax
	.p2align 4,,10
	.p2align 3
.L6:
	movslq	%ecx, %rcx
	movq	%rcx, %rdx
	movl	(%rax,%rcx,4), %ecx
	cmpl	%edx, %ecx
	jne	.L6
	movslq	%edi, %rsi
	movl	(%rax,%rsi,4), %ecx
	cmpl	%ecx, %edi
	jne	.L8
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%esi, %ecx
	movslq	%edi, %rsi
.L8:
	movl	%edx, (%rax,%rsi,4)
	movslq	%ecx, %rsi
	movl	%ecx, %edi
	movl	(%rax,%rsi,4), %esi
	cmpl	%ecx, %esi
	jne	.L12
.L7:
	movl	%r8d, %esi
	.p2align 4,,10
	.p2align 3
.L9:
	movslq	%esi, %rsi
	movq	%rsi, %rdx
	movl	(%rax,%rsi,4), %esi
	cmpl	%esi, %edx
	jne	.L9
	movslq	%r8d, %rdi
	movl	(%rax,%rdi,4), %esi
	cmpl	%esi, %r8d
	jne	.L11
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%edi, %esi
	movslq	%r8d, %rdi
.L11:
	movl	%edx, (%rax,%rdi,4)
	movslq	%esi, %rdi
	movl	%esi, %r8d
	movl	(%rax,%rdi,4), %edi
	cmpl	%esi, %edi
	jne	.L13
.L10:
	xorl	%eax, %eax
	cmpl	%ecx, %esi
	setne	%al
	ret
	.cfi_endproc
.LFE24:
	.size	Find, .-Find
	.p2align 4
	.globl	Union
	.type	Union, @function
Union:
.LFB25:
	.cfi_startproc
	endbr64
	movl	%edi, %r9d
	movl	%esi, %r8d
	leaq	p(%rip), %rax
	movl	%edi, %ecx
	.p2align 4,,10
	.p2align 3
.L17:
	movslq	%ecx, %rcx
	movq	%rcx, %rdx
	movl	(%rax,%rcx,4), %ecx
	cmpl	%ecx, %edx
	jne	.L17
	movslq	%r9d, %r10
	movl	(%rax,%r10,4), %esi
	cmpl	%esi, %r9d
	je	.L28
	movslq	%r9d, %rcx
	.p2align 4,,10
	.p2align 3
.L19:
	movl	%edx, (%rax,%rcx,4)
	movslq	%esi, %rcx
	movslq	%ecx, %rsi
	movl	(%rax,%rsi,4), %esi
	cmpl	%ecx, %esi
	jne	.L19
.L18:
	movl	%r8d, %edx
	.p2align 4,,10
	.p2align 3
.L20:
	movslq	%edx, %rdx
	movq	%rdx, %rsi
	movl	(%rax,%rdx,4), %edx
	cmpl	%edx, %esi
	jne	.L20
	movslq	%r8d, %r11
	movl	(%rax,%r11,4), %edi
	cmpl	%edi, %r8d
	je	.L29
	movslq	%r8d, %rdx
	.p2align 4,,10
	.p2align 3
.L22:
	movl	%esi, (%rax,%rdx,4)
	movslq	%edi, %rdx
	movslq	%edx, %rdi
	movl	(%rax,%rdi,4), %edi
	cmpl	%edx, %edi
	jne	.L22
	cmpl	%edx, %ecx
	jne	.L24
.L16:
	ret
	.p2align 4,,10
	.p2align 3
.L38:
	movslq	%r9d, %r10
.L24:
	movl	%r9d, %ecx
	movl	(%rax,%r10,4), %r9d
	cmpl	%r9d, %ecx
	jne	.L38
	movslq	%r8d, %rdx
	movl	(%rax,%r11,4), %r8d
	cmpl	%r8d, %edx
	je	.L36
	.p2align 4,,10
	.p2align 3
.L39:
	movslq	%r8d, %r11
	movslq	%r8d, %rdx
	movl	(%rax,%r11,4), %r8d
	cmpl	%r8d, %edx
	jne	.L39
.L36:
	leaq	d(%rip), %rdi
	movslq	%ecx, %rsi
	movl	(%rdi,%rsi,4), %r9d
	cmpl	(%rdi,%r11,4), %r9d
	jge	.L26
	movl	%r8d, (%rax,%rsi,4)
.L27:
	leaq	S(%rip), %rax
	movl	(%rax,%rdx,4), %ecx
	addl	(%rax,%rsi,4), %ecx
	movl	%ecx, (%rax,%rdx,4)
	movl	%ecx, (%rax,%rsi,4)
	ret
	.p2align 4,,10
	.p2align 3
.L26:
	movl	%ecx, (%rax,%r11,4)
	jne	.L27
	addl	$1, %r9d
	movl	%r9d, (%rdi,%rsi,4)
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L28:
	movl	%r9d, %ecx
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L29:
	movl	%r8d, %edx
	cmpl	%edx, %ecx
	je	.L16
	jmp	.L24
	.cfi_endproc
.LFE25:
	.size	Union, .-Union
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d %d"
.LC4:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB26:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	.LC1(%rip), %rbx
	movq	%rbx, %rdi
	subq	$32, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %ecx
	testl	%ecx, %ecx
	js	.L51
	leal	1(%rcx), %esi
	cmpl	$2, %ecx
	jle	.L44
	movl	%esi, %edx
	leaq	p(%rip), %rdi
	movdqa	.LC0(%rip), %xmm0
	movdqa	.LC2(%rip), %xmm2
	shrl	$2, %edx
	leaq	16(%rdi), %r8
	movq	%rdi, %rax
	subl	$1, %edx
	salq	$4, %rdx
	addq	%r8, %rdx
	.p2align 4,,10
	.p2align 3
.L45:
	movdqa	%xmm0, %xmm1
	addq	$16, %rax
	paddd	%xmm2, %xmm0
	movaps	%xmm1, -16(%rax)
	cmpq	%rdx, %rax
	jne	.L45
	movl	%esi, %eax
	andl	$-4, %eax
	testb	$3, %sil
	je	.L46
	movslq	%eax, %rdx
	movl	%eax, (%rdi,%rdx,4)
	addl	$1, %eax
	cmpl	%eax, %ecx
	jl	.L46
.L58:
	movslq	%eax, %rdx
	movl	%eax, (%rdi,%rdx,4)
	addl	$1, %eax
	cmpl	%ecx, %eax
	jg	.L48
	movslq	%eax, %rdx
	movl	%eax, (%rdi,%rdx,4)
.L48:
	cmpl	$2, %ecx
	jle	.L75
.L46:
	movl	%esi, %edx
	leaq	S(%rip), %rdi
	movdqa	.LC3(%rip), %xmm0
	shrl	$2, %edx
	leaq	16(%rdi), %r8
	movq	%rdi, %rax
	subl	$1, %edx
	salq	$4, %rdx
	addq	%r8, %rdx
	.p2align 4,,10
	.p2align 3
.L49:
	movaps	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L49
	movl	%esi, %eax
	andl	$-4, %eax
	andl	$3, %esi
	je	.L51
.L59:
	movslq	%eax, %rdx
	addl	$1, %eax
	movl	$1, (%rdi,%rdx,4)
	cmpl	%eax, %ecx
	jl	.L51
.L56:
	movslq	%eax, %rdx
	addl	$1, %eax
	movl	$1, (%rdi,%rdx,4)
	cmpl	%eax, %ecx
	jl	.L51
	cltq
	movl	$1, (%rdi,%rax,4)
.L51:
	movl	12(%rsp), %edx
	leaq	20(%rsp), %r12
	leaq	16(%rsp), %rbp
	movl	%edx, %eax
	subl	$1, %edx
	movl	%edx, 12(%rsp)
	testl	%eax, %eax
	je	.L43
	.p2align 4,,10
	.p2align 3
.L42:
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %esi
	movl	16(%rsp), %edi
	call	Union
	movl	12(%rsp), %edx
	movl	%edx, %eax
	subl	$1, %edx
	movl	%edx, 12(%rsp)
	testl	%eax, %eax
	jne	.L42
	movl	8(%rsp), %ecx
.L43:
	testl	%ecx, %ecx
	jle	.L53
	leaq	4+S(%rip), %rax
	leal	-1(%rcx), %esi
	xorl	%r8d, %r8d
	leaq	4(%rax), %rcx
	leaq	(%rcx,%rsi,4), %rdi
	movl	$-1, %esi
	.p2align 4,,10
	.p2align 3
.L55:
	movl	(%rax), %ecx
	cmpl	%esi, %ecx
	jle	.L54
	movl	%ecx, %esi
	movl	$1, %r8d
.L54:
	addq	$4, %rax
	cmpq	%rax, %rdi
	jne	.L55
	testb	%r8b, %r8b
	je	.L53
	movl	%esi, 12(%rsp)
	movl	%esi, %edx
.L53:
	xorl	%eax, %eax
	leaq	.LC4(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L76
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L44:
	.cfi_restore_state
	movl	$0, p(%rip)
	movl	$1, %eax
	leaq	p(%rip), %rdi
	testl	%ecx, %ecx
	jne	.L58
	xorl	%eax, %eax
	leaq	S(%rip), %rdi
	jmp	.L59
.L75:
	movl	$1, S(%rip)
	movl	$1, %eax
	leaq	S(%rip), %rdi
	jmp	.L56
.L76:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE26:
	.size	main, .-main
	.globl	S
	.bss
	.align 32
	.type	S, @object
	.size	S, 800040
S:
	.zero	800040
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 800040
d:
	.zero	800040
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 800040
p:
	.zero	800040
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC2:
	.long	4
	.long	4
	.long	4
	.long	4
	.align 16
.LC3:
	.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 p[200010];
int d[200010]={};
int S[200010];
int Top(int a){
  for(;p[a]-a;a=p[a]);
  return a;
}
int Find(int a,int b){
  int n,r;
  for(r=Top(a);p[a]!=a;a=n){
    n=p[a];
    p[a]=r;
  }
  for(r=Top(b);p[b]!=b;b=n){
    n=p[b];
    p[b]=r;
  }
  return a-b?1:0;
}
void Union(int a,int b){
  if(Find(a,b)){
    a=Top(a);
    b=Top(b);
    d[a]<d[b]?(p[a]=b):(p[b]=a);
    if(d[a]==d[b])d[a]++;
    S[a]=S[b]=S[a]+S[b];
  }
}
int main(){
  int i,n,m,a,b;
  scanf("%d %d",&n,&m);
  for(i=0;i<=n;i++)p[i]=i;
  for(i=0;i<=n;i++)S[i]=1;
  while(m--){
    scanf("%d %d",&a,&b);
    Union(a,b);
  }
  for(i=0;i<n;i++){
    if(m<S[i+1])m=S[i+1];
  }
  printf("%d\n",m);
  return 0;
}

10 4
3 1
3 1
5 9
2 6
 4 10
1 1
2 1
1 2
2 1
1 2
1 3
1 4
2 3
2 4
3 4
 2 0
1 1
2 1
1 6
2 1
1 2
1 3
1 4
3 3
2 4
4 4
 10 4
6 1
3 1
5 6
2 6
 5 2
1 4
3 4
3 1
 10 4
6 1
3 1
5 9
2 6
 4 10
1 1
2 1
1 2
2 1
1 2
1 3
1 4
1 3
2 4
3 4
 4 10
1 1
2 1
1 2
2 1
1 2
1 3
1 4
1 4
2 4
3 4
 5 3
1 2
3 4
3 1
 10 4
1 1
4 1
5 9
2 6

2
 4
 1
 5
 3
 4
 4
 4
 4
 2

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 p[200010];
int d[200010]={};
int S[200010];
int Top(int a){
  for(;p[a]-a;a=p[a]);
  return a;
}
int Find(int a,int b){
  int n,r;
  for(r=Top(a);p[a]!=a;a=n){
    n=p[a];
    p[a]=r;
  }
  for(r=Top(b);p[b]!=b;b=n){
    n=p[b];
    p[b]=r;
  }
  return a-b?1:0;
}
void Union(int a,int b){
  if(Find(a,b)){
    a=Top(a);
    b=Top(b);
    d[a]<d[b]?(p[a]=b):(p[b]=a);
    if(d[a]==d[b])d[a]++;
    S[a]=S[b]=S[a]+S[b];
  }
}
int main(){
  int i,n,m,a,b;
  scanf("%d %d",&n,&m);
  for(i=0;i<=n;i++)p[i]=i;
  for(i=0;i<=n;i++)S[i]=1;
  while(m--){
    scanf("%d %d",&a,&b);
    Union(a,b);
  }
  for(i=0;i<n;i++){
    if(m<S[i+1])m=S[i+1];
  }
  printf("%d\n",m);
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	p
	.bss
	.align 32
	.type	p, @object
	.size	p, 800040
p:
	.zero	800040
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 800040
d:
	.zero	800040
	.globl	S
	.align 32
	.type	S, @object
	.size	S, 800040
S:
	.zero	800040
	.text
	.globl	Top
	.type	Top, @function
Top:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	jmp	.L2
.L3:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	jne	.L3
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	Top, .-Top
	.globl	Find
	.type	Find, @function
Find:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$24, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	Top
	movl	%eax, -8(%rbp)
	jmp	.L6
.L7:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	movl	%eax, -20(%rbp)
.L6:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -20(%rbp)
	jne	.L7
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	call	Top
	movl	%eax, -8(%rbp)
	jmp	.L8
.L9:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	movl	%eax, -24(%rbp)
.L8:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -24(%rbp)
	jne	.L9
	movl	-20(%rbp), %eax
	cmpl	-24(%rbp), %eax
	setne	%al
	movzbl	%al, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	Find, .-Find
	.globl	Union
	.type	Union, @function
Union:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$8, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	Find
	testl	%eax, %eax
	je	.L16
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	Top
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, %edi
	call	Top
	movl	%eax, -8(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	d(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L13
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L14
.L13:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L14:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	d(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jne	.L15
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L15:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	S(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L16:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	Union, .-Union
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.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
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-24(%rbp), %rdx
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L18
.L19:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	addl	$1, -12(%rbp)
.L18:
	movl	-28(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L19
	movl	$0, -12(%rbp)
	jmp	.L20
.L21:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	movl	$1, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L20:
	movl	-28(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L21
	jmp	.L22
.L23:
	leaq	-16(%rbp), %rdx
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-16(%rbp), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	Union
.L22:
	movl	-24(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -24(%rbp)
	testl	%eax, %eax
	jne	.L23
	movl	$0, -12(%rbp)
	jmp	.L24
.L26:
	movl	-12(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L25
	movl	-12(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
.L25:
	addl	$1, -12(%rbp)
.L24:
	movl	-28(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L26
	movl	-24(%rbp), %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	.L28
	call	__stack_chk_fail@PLT
.L28:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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.
val
	.file	"temp.c"
	.text
	.globl	p
	.bss
	.align 32
	.type	p, @object
	.size	p, 800040
p:
	.zero	800040
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 800040
d:
	.zero	800040
	.globl	S
	.align 32
	.type	S, @object
	.size	S, 800040
S:
	.zero	800040
	.text
	.globl	Top
	.type	Top, @function
Top:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	jmp	.L2
.L3:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	jne	.L3
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	Top, .-Top
	.globl	Find
	.type	Find, @function
Find:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$24, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	Top
	movl	%eax, -8(%rbp)
	jmp	.L6
.L7:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	movl	%eax, -20(%rbp)
.L6:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -20(%rbp)
	jne	.L7
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	call	Top
	movl	%eax, -8(%rbp)
	jmp	.L8
.L9:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	movl	%eax, -24(%rbp)
.L8:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -24(%rbp)
	jne	.L9
	movl	-20(%rbp), %eax
	cmpl	-24(%rbp), %eax
	setne	%al
	movzbl	%al, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	Find, .-Find
	.globl	Union
	.type	Union, @function
Union:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$8, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	Find
	testl	%eax, %eax
	je	.L16
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	Top
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, %edi
	call	Top
	movl	%eax, -8(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	d(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L13
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L14
.L13:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L14:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	d(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jne	.L15
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L15:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	S(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L16:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	Union, .-Union
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.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
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-24(%rbp), %rdx
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L18
.L19:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	addl	$1, -12(%rbp)
.L18:
	movl	-28(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L19
	movl	$0, -12(%rbp)
	jmp	.L20
.L21:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	movl	$1, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L20:
	movl	-28(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L21
	jmp	.L22
.L23:
	leaq	-16(%rbp), %rdx
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-16(%rbp), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	Union
.L22:
	movl	-24(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -24(%rbp)
	testl	%eax, %eax
	jne	.L23
	movl	$0, -12(%rbp)
	jmp	.L24
.L26:
	movl	-12(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L25
	movl	-12(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
.L25:
	addl	$1, -12(%rbp)
.L24:
	movl	-28(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L26
	movl	-24(%rbp), %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	.L28
	call	__stack_chk_fail@PLT
.L28:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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:
