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>
#define limit 100000

int par[limit];
long long rank[limit];

void init(int N){
  for(int i = 0;i < N;i++){
    par[i] = i;
    rank[i] = 1;
  }
}

int root(int x){
  if(x == par[x]) return x;
  return par[x] = root(par[x]);
}

int same(int x,int y){
  if(root(x) == root(y))
    return 1;
  return 0;
}

long long unite(int x,int y){
  x = root(x);
  y = root(y);
  if(x == y) return 0;

  if(rank[x] < rank[y]){
    par[x] = y;
    rank[y] += rank[x];
    return rank[x]*(rank[y]-rank[x]);
  }else{
    par[y] = x;
    rank[x] += rank[y];
    return rank[y]*(rank[x]-rank[y]);
  }
}

int main(void){
  long long N,M;
  scanf("%lld%lld",&N,&M);

  int A[M],B[M];
  for(int i = 0;i < M;i++){
    scanf("%d%d",&A[i],&B[i]);
    A[i]--; B[i]--;
  }

  init(N);
  long long ans[M];
  ans[M-1] = N*(N-1)/2;
  for(int i = M-1;i > 0;i--){
    ans[i-1] = ans[i]-unite(A[i],B[i]);
  }

  for(int i = 0;i < M;i++){
    printf("%lld\n",ans[i]);
  }

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	par
	.bss
	.align 32
	.type	par, @object
	.size	par, 400000
par:
	.zero	400000
	.globl	rank
	.align 32
	.type	rank, @object
	.size	rank, 800000
rank:
	.zero	800000
	.text
	.globl	init
	.type	init, @function
init:
.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, -20(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L2
.L3:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	par(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	rank(%rip), %rax
	movq	$1, (%rdx,%rax)
	addl	$1, -4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L3
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	init, .-init
	.globl	root
	.type	root, @function
root:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	par(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	jne	.L5
	movl	-4(%rbp), %eax
	jmp	.L6
.L5:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	par(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %edi
	call	root
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	par(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	par(%rip), %rax
	movl	(%rdx,%rax), %eax
.L6:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	root, .-root
	.globl	same
	.type	same, @function
same:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 3, -24
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	root
	movl	%eax, %ebx
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	call	root
	cmpl	%eax, %ebx
	jne	.L8
	movl	$1, %eax
	jmp	.L9
.L8:
	movl	$0, %eax
.L9:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	same, .-same
	.globl	unite
	.type	unite, @function
unite:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	root
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, %edi
	call	root
	movl	%eax, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jne	.L11
	movl	$0, %eax
	jmp	.L12
.L11:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	rank(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	rank(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	jge	.L13
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	par(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	rank(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	rank(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	rank(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	rank(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	-8(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	rank(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	movl	-4(%rbp), %ecx
	movslq	%ecx, %rcx
	leaq	0(,%rcx,8), %rsi
	leaq	rank(%rip), %rcx
	movq	(%rsi,%rcx), %rcx
	subq	%rcx, %rdx
	imulq	%rdx, %rax
	jmp	.L12
.L13:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	par(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	rank(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	rank(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	rank(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	rank(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	rank(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	movl	-8(%rbp), %ecx
	movslq	%ecx, %rcx
	leaq	0(,%rcx,8), %rsi
	leaq	rank(%rip), %rcx
	movq	(%rsi,%rcx), %rcx
	subq	%rcx, %rdx
	imulq	%rdx, %rax
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	unite, .-unite
	.section	.rodata
.LC0:
	.string	"%lld%lld"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	subq	$176, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 12, -40
	.cfi_offset 3, -48
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %r12
	leaq	-96(%rbp), %rax
	leaq	-104(%rbp), %rcx
	movq	%rax, %rdx
	movq	%rcx, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-96(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -88(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -144(%rbp)
	movq	$0, -136(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -160(%rbp)
	movq	$0, -152(%rbp)
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L15:
	cmpq	%rdx, %rsp
	je	.L16
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L15
.L16:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L17
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L17:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -80(%rbp)
	movq	-96(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -72(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -176(%rbp)
	movq	$0, -168(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -192(%rbp)
	movq	$0, -184(%rbp)
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L18:
	cmpq	%rdx, %rsp
	je	.L19
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L18
.L19:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L20
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L20:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -116(%rbp)
	jmp	.L21
.L22:
	movl	-116(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-64(%rbp), %rax
	addq	%rax, %rdx
	movl	-116(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-80(%rbp), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-80(%rbp), %rax
	movl	-116(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	leal	-1(%rax), %ecx
	movq	-80(%rbp), %rax
	movl	-116(%rbp), %edx
	movslq	%edx, %rdx
	movl	%ecx, (%rax,%rdx,4)
	movq	-64(%rbp), %rax
	movl	-116(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	leal	-1(%rax), %ecx
	movq	-64(%rbp), %rax
	movl	-116(%rbp), %edx
	movslq	%edx, %rdx
	movl	%ecx, (%rax,%rdx,4)
	addl	$1, -116(%rbp)
.L21:
	movl	-116(%rbp), %eax
	movslq	%eax, %rdx
	movq	-96(%rbp), %rax
	cmpq	%rax, %rdx
	jl	.L22
	movq	-104(%rbp), %rax
	movl	%eax, %edi
	call	init
	movq	-96(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -56(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -208(%rbp)
	movq	$0, -200(%rbp)
	movq	%rax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L23:
	cmpq	%rdx, %rsp
	je	.L24
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L23
.L24:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L25
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L25:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -48(%rbp)
	movq	-104(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	-104(%rbp), %rax
	imulq	%rdx, %rax
	movq	-96(%rbp), %rdx
	subq	$1, %rdx
	movq	%rax, %rcx
	shrq	$63, %rcx
	addq	%rcx, %rax
	sarq	%rax
	movq	%rax, %rcx
	movq	-48(%rbp), %rax
	movq	%rcx, (%rax,%rdx,8)
	movq	-96(%rbp), %rax
	subl	$1, %eax
	movl	%eax, -112(%rbp)
	jmp	.L26
.L27:
	movq	-48(%rbp), %rax
	movl	-112(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rbx
	movq	-64(%rbp), %rax
	movl	-112(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movq	-80(%rbp), %rax
	movl	-112(%rbp), %ecx
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,4), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	unite
	movq	%rax, %rsi
	movl	-112(%rbp), %eax
	leal	-1(%rax), %edx
	subq	%rsi, %rbx
	movq	%rbx, %rcx
	movq	-48(%rbp), %rax
	movslq	%edx, %rdx
	movq	%rcx, (%rax,%rdx,8)
	subl	$1, -112(%rbp)
.L26:
	cmpl	$0, -112(%rbp)
	jg	.L27
	movl	$0, -108(%rbp)
	jmp	.L28
.L29:
	movq	-48(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -108(%rbp)
.L28:
	movl	-108(%rbp), %eax
	movslq	%eax, %rdx
	movq	-96(%rbp), %rax
	cmpq	%rax, %rdx
	jl	.L29
	movl	$0, %eax
	movq	%r12, %rsp
	movq	-40(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	leaq	-32(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.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	init
	.type	init, @function
init:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%edi, %esi
	testl	%edi, %edi
	jle	.L1
	leal	-1(%rdi), %eax
	cmpl	$2, %eax
	jbe	.L6
	movl	%esi, %ecx
	leaq	par(%rip), %r8
	leaq	rank(%rip), %rdi
	movdqa	.LC0(%rip), %xmm0
	shrl	$2, %ecx
	leaq	16(%r8), %r9
	movq	%r8, %rdx
	movq	%rdi, %rax
	subl	$1, %ecx
	movdqa	.LC1(%rip), %xmm3
	movdqa	.LC2(%rip), %xmm1
	salq	$4, %rcx
	addq	%r9, %rcx
	.p2align 4,,10
	.p2align 3
.L4:
	movdqa	%xmm0, %xmm2
	addq	$16, %rdx
	paddd	%xmm3, %xmm0
	addq	$32, %rax
	movaps	%xmm2, -16(%rdx)
	movaps	%xmm1, -32(%rax)
	movaps	%xmm1, -16(%rax)
	cmpq	%rcx, %rdx
	jne	.L4
	movl	%esi, %eax
	andl	$-4, %eax
	testb	$3, %sil
	je	.L9
.L3:
	movslq	%eax, %rdx
	movl	%eax, (%r8,%rdx,4)
	movq	$1, (%rdi,%rdx,8)
	leal	1(%rax), %edx
	cmpl	%edx, %esi
	jle	.L1
	movslq	%edx, %rcx
	addl	$2, %eax
	movl	%edx, (%r8,%rcx,4)
	movq	$1, (%rdi,%rcx,8)
	cmpl	%eax, %esi
	jle	.L1
	movslq	%eax, %rdx
	movl	%eax, (%r8,%rdx,4)
	movq	$1, (%rdi,%rdx,8)
.L1:
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	ret
.L6:
	xorl	%eax, %eax
	leaq	par(%rip), %r8
	leaq	rank(%rip), %rdi
	jmp	.L3
	.cfi_endproc
.LFE23:
	.size	init, .-init
	.p2align 4
	.globl	root
	.type	root, @function
root:
.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
	movslq	%edi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	par(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movl	(%rbx,%rbp,4), %edx
	movl	%edx, %eax
	cmpl	%edi, %edx
	je	.L10
	movslq	%edx, %r12
	movl	(%rbx,%r12,4), %eax
	cmpl	%eax, %edx
	je	.L12
	movslq	%eax, %r13
	movl	(%rbx,%r13,4), %edx
	cmpl	%edx, %eax
	je	.L13
	movslq	%edx, %r14
	movl	(%rbx,%r14,4), %eax
	cmpl	%eax, %edx
	je	.L14
	movslq	%eax, %r15
	movl	(%rbx,%r15,4), %edx
	cmpl	%edx, %eax
	je	.L15
	movslq	%edx, %rcx
	movl	(%rbx,%rcx,4), %eax
	movq	%rcx, 8(%rsp)
	cmpl	%eax, %edx
	je	.L16
	movl	%eax, %edi
	call	root
	movq	8(%rsp), %rcx
	movl	%eax, (%rbx,%rcx,4)
.L16:
	movl	%eax, (%rbx,%r15,4)
.L15:
	movl	%eax, (%rbx,%r14,4)
.L14:
	movl	%eax, (%rbx,%r13,4)
.L13:
	movl	%eax, (%rbx,%r12,4)
.L12:
	movl	%eax, (%rbx,%rbp,4)
.L10:
	addq	$24, %rsp
	.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
	.cfi_endproc
.LFE24:
	.size	root, .-root
	.p2align 4
	.globl	same
	.type	same, @function
same:
.LFB25:
	.cfi_startproc
	endbr64
	leaq	par(%rip), %r9
	movslq	%edi, %r10
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movl	%esi, %r8d
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movl	(%r9,%r10,4), %esi
	cmpl	%esi, %edi
	je	.L23
	movslq	%esi, %r11
	movl	(%r9,%r11,4), %eax
	cmpl	%eax, %esi
	je	.L24
	movslq	%eax, %rbx
	movl	(%r9,%rbx,4), %esi
	cmpl	%esi, %eax
	je	.L25
	movslq	%esi, %rbp
	movl	(%r9,%rbp,4), %eax
	cmpl	%eax, %esi
	je	.L26
	movslq	%eax, %r12
	movl	(%r9,%r12,4), %esi
	cmpl	%esi, %eax
	je	.L27
	movl	%esi, %edi
	call	root
	movl	%eax, (%r9,%r12,4)
	movl	%eax, %esi
.L27:
	movl	%esi, (%r9,%rbp,4)
.L26:
	movl	%esi, (%r9,%rbx,4)
.L25:
	movl	%esi, (%r9,%r11,4)
.L24:
	movl	%esi, (%r9,%r10,4)
.L23:
	movslq	%r8d, %r10
	movl	(%r9,%r10,4), %edi
	cmpl	%edi, %r8d
	je	.L28
	movslq	%edi, %r8
	movl	(%r9,%r8,4), %eax
	cmpl	%eax, %edi
	je	.L29
	movslq	%eax, %r11
	movl	(%r9,%r11,4), %edi
	cmpl	%edi, %eax
	je	.L30
	movslq	%edi, %rbx
	movl	(%r9,%rbx,4), %eax
	cmpl	%eax, %edi
	je	.L31
	movslq	%eax, %rbp
	movl	(%r9,%rbp,4), %edi
	cmpl	%edi, %eax
	je	.L32
	call	root
	movl	%eax, (%r9,%rbp,4)
	movl	%eax, %edi
.L32:
	movl	%edi, (%r9,%rbx,4)
.L31:
	movl	%edi, (%r9,%r11,4)
.L30:
	movl	%edi, (%r9,%r8,4)
.L29:
	movl	%edi, (%r9,%r10,4)
.L28:
	xorl	%eax, %eax
	cmpl	%esi, %edi
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	sete	%al
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE25:
	.size	same, .-same
	.p2align 4
	.globl	unite
	.type	unite, @function
unite:
.LFB26:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	par(%rip), %r9
	movslq	%edi, %r10
	movl	%esi, %r8d
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	movl	(%r9,%r10,4), %esi
	cmpl	%esi, %edi
	je	.L39
	movslq	%esi, %r11
	movl	(%r9,%r11,4), %eax
	cmpl	%eax, %esi
	je	.L40
	movslq	%eax, %rbx
	movl	(%r9,%rbx,4), %esi
	cmpl	%esi, %eax
	je	.L41
	movslq	%esi, %rbp
	movl	(%r9,%rbp,4), %edi
	cmpl	%edi, %esi
	je	.L42
	call	root
	movl	%eax, (%r9,%rbp,4)
	movl	%eax, %esi
.L42:
	movl	%esi, (%r9,%rbx,4)
.L41:
	movl	%esi, (%r9,%r11,4)
.L40:
	movl	%esi, (%r9,%r10,4)
.L39:
	movslq	%r8d, %r10
	movl	(%r9,%r10,4), %edx
	cmpl	%edx, %r8d
	je	.L43
	movslq	%edx, %r8
	movl	(%r9,%r8,4), %eax
	cmpl	%eax, %edx
	je	.L44
	movslq	%eax, %r11
	movl	(%r9,%r11,4), %edx
	cmpl	%edx, %eax
	je	.L45
	movslq	%edx, %rbx
	movl	(%r9,%rbx,4), %edi
	cmpl	%edi, %edx
	je	.L46
	call	root
	movl	%eax, (%r9,%rbx,4)
	movl	%eax, %edx
.L46:
	movl	%edx, (%r9,%r11,4)
.L45:
	movl	%edx, (%r9,%r8,4)
.L44:
	movl	%edx, (%r9,%r10,4)
.L43:
	xorl	%eax, %eax
	cmpl	%esi, %edx
	je	.L38
	leaq	rank(%rip), %rcx
	movslq	%esi, %r8
	movslq	%edx, %rdi
	movq	(%rcx,%r8,8), %r11
	movq	(%rcx,%rdi,8), %r10
	leaq	(%r11,%r10), %rax
	cmpq	%r10, %r11
	jge	.L48
	movq	%rax, (%rcx,%rdi,8)
	movl	%edx, (%r9,%r8,4)
	movq	(%rcx,%r8,8), %rdx
	subq	%rdx, %rax
	imulq	%rdx, %rax
.L38:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L48:
	.cfi_restore_state
	movq	%rax, (%rcx,%r8,8)
	movq	(%rcx,%rdi,8), %rdx
	movl	%esi, (%r9,%rdi,4)
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	subq	%rdx, %rax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	imulq	%rdx, %rax
	ret
	.cfi_endproc
.LFE26:
	.size	unite, .-unite
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC3:
	.string	"%lld%lld"
.LC4:
	.string	"%d%d"
.LC5:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB27:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC3(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-64(%rbp), %rdx
	leaq	-72(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rax
	movq	%rsp, %rsi
	leaq	15(,%rax,4), %rdx
	movq	%rdx, %rdi
	movq	%rdx, %rcx
	andq	$-4096, %rdi
	andq	$-16, %rcx
	subq	%rdi, %rsi
	cmpq	%rsi, %rsp
	je	.L57
.L97:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L97
.L57:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L98
.L58:
	movq	%rdx, %rcx
	movq	%rsp, %rsi
	andq	$-4096, %rdx
	movq	%rsp, %r13
	andq	$-16, %rcx
	subq	%rdx, %rsi
.L59:
	cmpq	%rsi, %rsp
	je	.L60
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L59
.L98:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L58
.L60:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L99
.L61:
	movq	%rsp, %r14
	testq	%rax, %rax
	jle	.L62
	movq	%r13, %r12
	movq	%r14, %rbx
	xorl	%r15d, %r15d
	.p2align 4,,10
	.p2align 3
.L63:
	movq	%rbx, %rdx
	movq	%r12, %rsi
	leaq	.LC4(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rax
	addq	$1, %r15
	subl	$1, (%rbx)
	subl	$1, (%r12)
	addq	$4, %rbx
	addq	$4, %r12
	cmpq	%r15, %rax
	jg	.L63
.L62:
	movq	-72(%rbp), %rdi
	testl	%edi, %edi
	jle	.L73
	leal	-1(%rdi), %edx
	cmpl	$2, %edx
	jbe	.L79
	movl	%edi, %esi
	leaq	rank(%rip), %r8
	leaq	par(%rip), %r9
	movdqa	.LC0(%rip), %xmm0
	shrl	$2, %esi
	leaq	32(%r8), %r10
	movq	%r8, %rdx
	movq	%r9, %rcx
	subl	$1, %esi
	movdqa	.LC1(%rip), %xmm3
	movdqa	.LC2(%rip), %xmm1
	salq	$5, %rsi
	addq	%r10, %rsi
	.p2align 4,,10
	.p2align 3
.L71:
	movdqa	%xmm0, %xmm2
	addq	$32, %rdx
	paddd	%xmm3, %xmm0
	addq	$16, %rcx
	movaps	%xmm2, -16(%rcx)
	movaps	%xmm1, -32(%rdx)
	movaps	%xmm1, -16(%rdx)
	cmpq	%rsi, %rdx
	jne	.L71
	movl	%edi, %edx
	andl	$-4, %edx
	testb	$3, %dil
	je	.L73
.L70:
	movslq	%edx, %rcx
	movl	%edx, (%r9,%rcx,4)
	movq	$1, (%r8,%rcx,8)
	leal	1(%rdx), %ecx
	cmpl	%ecx, %edi
	jle	.L73
	movslq	%ecx, %rsi
	addl	$2, %edx
	movl	%ecx, (%r9,%rsi,4)
	movq	$1, (%r8,%rsi,8)
	cmpl	%edx, %edi
	jle	.L73
	movslq	%edx, %rcx
	movl	%edx, (%r9,%rcx,4)
	movq	$1, (%r8,%rcx,8)
.L73:
	leaq	15(,%rax,8), %rdx
	movq	%rsp, %rsi
	movq	%rdx, %rcx
	andq	$-4096, %rdx
	subq	%rdx, %rsi
	andq	$-16, %rcx
	cmpq	%rsi, %rsp
	je	.L66
.L100:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L100
.L66:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	je	.L67
	orq	$0, -8(%rsp,%rcx)
.L67:
	leaq	-1(%rdi), %rcx
	movq	%rsp, %r12
	imulq	%rdi, %rcx
	movq	%rcx, %rdx
	shrq	$63, %rdx
	addq	%rcx, %rdx
	sarq	%rdx
	movq	%rdx, -8(%r12,%rax,8)
	leal	-1(%rax), %edx
	testl	%edx, %edx
	jle	.L69
	subl	$2, %eax
	movslq	%edx, %r15
	cltq
	subq	%r15, %rax
	leaq	(%r12,%rax,8), %rax
	movq	%rax, -88(%rbp)
	.p2align 4,,10
	.p2align 3
.L77:
	movl	(%r14,%r15,4), %esi
	movl	0(%r13,%r15,4), %edi
	movq	(%r12,%r15,8), %rbx
	call	unite
	subq	%rax, %rbx
	movq	-88(%rbp), %rax
	movq	%rbx, (%rax,%r15,8)
	subq	$1, %r15
	testl	%r15d, %r15d
	jg	.L77
.L69:
	xorl	%ebx, %ebx
	cmpq	$0, -64(%rbp)
	leaq	.LC5(%rip), %r13
	jle	.L76
	.p2align 4,,10
	.p2align 3
.L75:
	movq	(%r12,%rbx,8), %rdx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpq	%rbx, -64(%rbp)
	jg	.L75
.L76:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L101
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L79:
	.cfi_restore_state
	xorl	%edx, %edx
	leaq	rank(%rip), %r8
	leaq	par(%rip), %r9
	jmp	.L70
.L99:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L61
.L101:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE27:
	.size	main, .-main
	.globl	rank
	.bss
	.align 32
	.type	rank, @object
	.size	rank, 800000
rank:
	.zero	800000
	.globl	par
	.align 32
	.type	par, @object
	.size	par, 400000
par:
	.zero	400000
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC1:
	.long	4
	.long	4
	.long	4
	.long	4
	.align 16
.LC2:
	.quad	1
	.quad	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	init
	.type	init, @function
init:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%edi, %esi
	testl	%edi, %edi
	jle	.L1
	leal	-1(%rdi), %eax
	cmpl	$2, %eax
	jbe	.L6
	movl	%esi, %ecx
	leaq	par(%rip), %r8
	leaq	rank(%rip), %rdi
	movdqa	.LC0(%rip), %xmm0
	shrl	$2, %ecx
	leaq	16(%r8), %r9
	movq	%r8, %rdx
	movq	%rdi, %rax
	subl	$1, %ecx
	movdqa	.LC1(%rip), %xmm3
	movdqa	.LC2(%rip), %xmm1
	salq	$4, %rcx
	addq	%r9, %rcx
	.p2align 4,,10
	.p2align 3
.L4:
	movdqa	%xmm0, %xmm2
	addq	$16, %rdx
	paddd	%xmm3, %xmm0
	addq	$32, %rax
	movaps	%xmm2, -16(%rdx)
	movaps	%xmm1, -32(%rax)
	movaps	%xmm1, -16(%rax)
	cmpq	%rcx, %rdx
	jne	.L4
	movl	%esi, %eax
	andl	$-4, %eax
	testb	$3, %sil
	je	.L9
.L3:
	movslq	%eax, %rdx
	movl	%eax, (%r8,%rdx,4)
	movq	$1, (%rdi,%rdx,8)
	leal	1(%rax), %edx
	cmpl	%edx, %esi
	jle	.L1
	movslq	%edx, %rcx
	addl	$2, %eax
	movl	%edx, (%r8,%rcx,4)
	movq	$1, (%rdi,%rcx,8)
	cmpl	%eax, %esi
	jle	.L1
	movslq	%eax, %rdx
	movl	%eax, (%r8,%rdx,4)
	movq	$1, (%rdi,%rdx,8)
.L1:
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	ret
.L6:
	xorl	%eax, %eax
	leaq	par(%rip), %r8
	leaq	rank(%rip), %rdi
	jmp	.L3
	.cfi_endproc
.LFE23:
	.size	init, .-init
	.p2align 4
	.globl	root
	.type	root, @function
root:
.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
	movslq	%edi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	par(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movl	(%rbx,%rbp,4), %edx
	movl	%edx, %eax
	cmpl	%edi, %edx
	je	.L10
	movslq	%edx, %r12
	movl	(%rbx,%r12,4), %eax
	cmpl	%eax, %edx
	je	.L12
	movslq	%eax, %r13
	movl	(%rbx,%r13,4), %edx
	cmpl	%edx, %eax
	je	.L13
	movslq	%edx, %r14
	movl	(%rbx,%r14,4), %eax
	cmpl	%eax, %edx
	je	.L14
	movslq	%eax, %r15
	movl	(%rbx,%r15,4), %edx
	cmpl	%edx, %eax
	je	.L15
	movslq	%edx, %rcx
	movl	(%rbx,%rcx,4), %eax
	movq	%rcx, 8(%rsp)
	cmpl	%eax, %edx
	je	.L16
	movl	%eax, %edi
	call	root
	movq	8(%rsp), %rcx
	movl	%eax, (%rbx,%rcx,4)
.L16:
	movl	%eax, (%rbx,%r15,4)
.L15:
	movl	%eax, (%rbx,%r14,4)
.L14:
	movl	%eax, (%rbx,%r13,4)
.L13:
	movl	%eax, (%rbx,%r12,4)
.L12:
	movl	%eax, (%rbx,%rbp,4)
.L10:
	addq	$24, %rsp
	.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
	.cfi_endproc
.LFE24:
	.size	root, .-root
	.p2align 4
	.globl	same
	.type	same, @function
same:
.LFB25:
	.cfi_startproc
	endbr64
	leaq	par(%rip), %r9
	movslq	%edi, %r10
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movl	%esi, %r8d
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movl	(%r9,%r10,4), %esi
	cmpl	%esi, %edi
	je	.L23
	movslq	%esi, %r11
	movl	(%r9,%r11,4), %eax
	cmpl	%eax, %esi
	je	.L24
	movslq	%eax, %rbx
	movl	(%r9,%rbx,4), %esi
	cmpl	%esi, %eax
	je	.L25
	movslq	%esi, %rbp
	movl	(%r9,%rbp,4), %eax
	cmpl	%eax, %esi
	je	.L26
	movslq	%eax, %r12
	movl	(%r9,%r12,4), %esi
	cmpl	%esi, %eax
	je	.L27
	movl	%esi, %edi
	call	root
	movl	%eax, (%r9,%r12,4)
	movl	%eax, %esi
.L27:
	movl	%esi, (%r9,%rbp,4)
.L26:
	movl	%esi, (%r9,%rbx,4)
.L25:
	movl	%esi, (%r9,%r11,4)
.L24:
	movl	%esi, (%r9,%r10,4)
.L23:
	movslq	%r8d, %r10
	movl	(%r9,%r10,4), %edi
	cmpl	%edi, %r8d
	je	.L28
	movslq	%edi, %r8
	movl	(%r9,%r8,4), %eax
	cmpl	%eax, %edi
	je	.L29
	movslq	%eax, %r11
	movl	(%r9,%r11,4), %edi
	cmpl	%edi, %eax
	je	.L30
	movslq	%edi, %rbx
	movl	(%r9,%rbx,4), %eax
	cmpl	%eax, %edi
	je	.L31
	movslq	%eax, %rbp
	movl	(%r9,%rbp,4), %edi
	cmpl	%edi, %eax
	je	.L32
	call	root
	movl	%eax, (%r9,%rbp,4)
	movl	%eax, %edi
.L32:
	movl	%edi, (%r9,%rbx,4)
.L31:
	movl	%edi, (%r9,%r11,4)
.L30:
	movl	%edi, (%r9,%r8,4)
.L29:
	movl	%edi, (%r9,%r10,4)
.L28:
	xorl	%eax, %eax
	cmpl	%esi, %edi
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	sete	%al
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE25:
	.size	same, .-same
	.p2align 4
	.globl	unite
	.type	unite, @function
unite:
.LFB26:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	par(%rip), %r9
	movslq	%edi, %r10
	movl	%esi, %r8d
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	movl	(%r9,%r10,4), %esi
	cmpl	%esi, %edi
	je	.L39
	movslq	%esi, %r11
	movl	(%r9,%r11,4), %eax
	cmpl	%eax, %esi
	je	.L40
	movslq	%eax, %rbx
	movl	(%r9,%rbx,4), %esi
	cmpl	%esi, %eax
	je	.L41
	movslq	%esi, %rbp
	movl	(%r9,%rbp,4), %edi
	cmpl	%edi, %esi
	je	.L42
	call	root
	movl	%eax, (%r9,%rbp,4)
	movl	%eax, %esi
.L42:
	movl	%esi, (%r9,%rbx,4)
.L41:
	movl	%esi, (%r9,%r11,4)
.L40:
	movl	%esi, (%r9,%r10,4)
.L39:
	movslq	%r8d, %r10
	movl	(%r9,%r10,4), %edx
	cmpl	%edx, %r8d
	je	.L43
	movslq	%edx, %r8
	movl	(%r9,%r8,4), %eax
	cmpl	%eax, %edx
	je	.L44
	movslq	%eax, %r11
	movl	(%r9,%r11,4), %edx
	cmpl	%edx, %eax
	je	.L45
	movslq	%edx, %rbx
	movl	(%r9,%rbx,4), %edi
	cmpl	%edi, %edx
	je	.L46
	call	root
	movl	%eax, (%r9,%rbx,4)
	movl	%eax, %edx
.L46:
	movl	%edx, (%r9,%r11,4)
.L45:
	movl	%edx, (%r9,%r8,4)
.L44:
	movl	%edx, (%r9,%r10,4)
.L43:
	xorl	%eax, %eax
	cmpl	%esi, %edx
	je	.L38
	leaq	rank(%rip), %rcx
	movslq	%esi, %r8
	movslq	%edx, %rdi
	movq	(%rcx,%r8,8), %r11
	movq	(%rcx,%rdi,8), %r10
	leaq	(%r11,%r10), %rax
	cmpq	%r10, %r11
	jge	.L48
	movq	%rax, (%rcx,%rdi,8)
	movl	%edx, (%r9,%r8,4)
	movq	(%rcx,%r8,8), %rdx
	subq	%rdx, %rax
	imulq	%rdx, %rax
.L38:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L48:
	.cfi_restore_state
	movq	%rax, (%rcx,%r8,8)
	movq	(%rcx,%rdi,8), %rdx
	movl	%esi, (%r9,%rdi,4)
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	subq	%rdx, %rax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	imulq	%rdx, %rax
	ret
	.cfi_endproc
.LFE26:
	.size	unite, .-unite
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC3:
	.string	"%lld%lld"
.LC4:
	.string	"%d%d"
.LC5:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB27:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC3(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-64(%rbp), %rdx
	leaq	-72(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rax
	movq	%rsp, %rsi
	leaq	15(,%rax,4), %rdx
	movq	%rdx, %rdi
	movq	%rdx, %rcx
	andq	$-4096, %rdi
	andq	$-16, %rcx
	subq	%rdi, %rsi
	cmpq	%rsi, %rsp
	je	.L57
.L97:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L97
.L57:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L98
.L58:
	movq	%rdx, %rcx
	movq	%rsp, %rsi
	andq	$-4096, %rdx
	movq	%rsp, %r13
	andq	$-16, %rcx
	subq	%rdx, %rsi
.L59:
	cmpq	%rsi, %rsp
	je	.L60
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L59
.L98:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L58
.L60:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L99
.L61:
	movq	%rsp, %r14
	testq	%rax, %rax
	jle	.L62
	movq	%r13, %r12
	movq	%r14, %rbx
	xorl	%r15d, %r15d
	.p2align 4,,10
	.p2align 3
.L63:
	movq	%rbx, %rdx
	movq	%r12, %rsi
	leaq	.LC4(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rax
	addq	$1, %r15
	subl	$1, (%rbx)
	subl	$1, (%r12)
	addq	$4, %rbx
	addq	$4, %r12
	cmpq	%r15, %rax
	jg	.L63
.L62:
	movq	-72(%rbp), %rdi
	testl	%edi, %edi
	jle	.L73
	leal	-1(%rdi), %edx
	cmpl	$2, %edx
	jbe	.L79
	movl	%edi, %esi
	leaq	rank(%rip), %r8
	leaq	par(%rip), %r9
	movdqa	.LC0(%rip), %xmm0
	shrl	$2, %esi
	leaq	32(%r8), %r10
	movq	%r8, %rdx
	movq	%r9, %rcx
	subl	$1, %esi
	movdqa	.LC1(%rip), %xmm3
	movdqa	.LC2(%rip), %xmm1
	salq	$5, %rsi
	addq	%r10, %rsi
	.p2align 4,,10
	.p2align 3
.L71:
	movdqa	%xmm0, %xmm2
	addq	$32, %rdx
	paddd	%xmm3, %xmm0
	addq	$16, %rcx
	movaps	%xmm2, -16(%rcx)
	movaps	%xmm1, -32(%rdx)
	movaps	%xmm1, -16(%rdx)
	cmpq	%rsi, %rdx
	jne	.L71
	movl	%edi, %edx
	andl	$-4, %edx
	testb	$3, %dil
	je	.L73
.L70:
	movslq	%edx, %rcx
	movl	%edx, (%r9,%rcx,4)
	movq	$1, (%r8,%rcx,8)
	leal	1(%rdx), %ecx
	cmpl	%ecx, %edi
	jle	.L73
	movslq	%ecx, %rsi
	addl	$2, %edx
	movl	%ecx, (%r9,%rsi,4)
	movq	$1, (%r8,%rsi,8)
	cmpl	%edx, %edi
	jle	.L73
	movslq	%edx, %rcx
	movl	%edx, (%r9,%rcx,4)
	movq	$1, (%r8,%rcx,8)
.L73:
	leaq	15(,%rax,8), %rdx
	movq	%rsp, %rsi
	movq	%rdx, %rcx
	andq	$-4096, %rdx
	subq	%rdx, %rsi
	andq	$-16, %rcx
	cmpq	%rsi, %rsp
	je	.L66
.L100:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L100
.L66:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	je	.L67
	orq	$0, -8(%rsp,%rcx)
.L67:
	leaq	-1(%rdi), %rcx
	movq	%rsp, %r12
	imulq	%rdi, %rcx
	movq	%rcx, %rdx
	shrq	$63, %rdx
	addq	%rcx, %rdx
	sarq	%rdx
	movq	%rdx, -8(%r12,%rax,8)
	leal	-1(%rax), %edx
	testl	%edx, %edx
	jle	.L69
	subl	$2, %eax
	movslq	%edx, %r15
	cltq
	subq	%r15, %rax
	leaq	(%r12,%rax,8), %rax
	movq	%rax, -88(%rbp)
	.p2align 4,,10
	.p2align 3
.L77:
	movl	(%r14,%r15,4), %esi
	movl	0(%r13,%r15,4), %edi
	movq	(%r12,%r15,8), %rbx
	call	unite
	subq	%rax, %rbx
	movq	-88(%rbp), %rax
	movq	%rbx, (%rax,%r15,8)
	subq	$1, %r15
	testl	%r15d, %r15d
	jg	.L77
.L69:
	xorl	%ebx, %ebx
	cmpq	$0, -64(%rbp)
	leaq	.LC5(%rip), %r13
	jle	.L76
	.p2align 4,,10
	.p2align 3
.L75:
	movq	(%r12,%rbx,8), %rdx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpq	%rbx, -64(%rbp)
	jg	.L75
.L76:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L101
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L79:
	.cfi_restore_state
	xorl	%edx, %edx
	leaq	rank(%rip), %r8
	leaq	par(%rip), %r9
	jmp	.L70
.L99:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L61
.L101:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE27:
	.size	main, .-main
	.globl	rank
	.bss
	.align 32
	.type	rank, @object
	.size	rank, 800000
rank:
	.zero	800000
	.globl	par
	.align 32
	.type	par, @object
	.size	par, 400000
par:
	.zero	400000
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC1:
	.long	4
	.long	4
	.long	4
	.long	4
	.align 16
.LC2:
	.quad	1
	.quad	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>
#define limit 100000

int par[limit];
long long rank[limit];

void init(int N){
  for(int i = 0;i < N;i++){
    par[i] = i;
    rank[i] = 1;
  }
}

int root(int x){
  if(x == par[x]) return x;
  return par[x] = root(par[x]);
}

int same(int x,int y){
  if(root(x) == root(y))
    return 1;
  return 0;
}

long long unite(int x,int y){
  x = root(x);
  y = root(y);
  if(x == y) return 0;

  if(rank[x] < rank[y]){
    par[x] = y;
    rank[y] += rank[x];
    return rank[x]*(rank[y]-rank[x]);
  }else{
    par[y] = x;
    rank[x] += rank[y];
    return rank[y]*(rank[x]-rank[y]);
  }
}

int main(void){
  long long N,M;
  scanf("%lld%lld",&N,&M);

  int A[M],B[M];
  for(int i = 0;i < M;i++){
    scanf("%d%d",&A[i],&B[i]);
    A[i]--; B[i]--;
  }

  init(N);
  long long ans[M];
  ans[M-1] = N*(N-1)/2;
  for(int i = M-1;i > 0;i--){
    ans[i-1] = ans[i]-unite(A[i],B[i]);
  }

  for(int i = 0;i < M;i++){
    printf("%lld\n",ans[i]);
  }

  return 0;
}
6 5
3 3
1 2
5 6
3 4
4 5
 4 5
1 2
3 4
1 3
3 3
1 4
 2 1
2 2
 6 5
3 3
1 2
5 6
3 4
2 5
 4 5
1 2
3 4
1 3
3 3
1 1
 6 5
2 3
1 2
5 6
3 4
4 3
 4 5
1 0
3 4
1 3
2 3
1 4
 6 5
3 3
1 1
5 6
3 4
4 5
 4 5
1 2
3 4
1 3
3 2
1 1
 4 1
1 3
3 4
1 3
3 3
1 1

8
9
12
14
15
 3
3
5
5
6
 1
 8
11
13
14
15
 3
5
6
6
6
 12
13
14
14
15
 0
0
4
5
6
 9
9
12
14
15
 0
3
5
6
6
 6

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>
#define limit 100000

int par[limit];
long long rank[limit];

void init(int N){
  for(int i = 0;i < N;i++){
    par[i] = i;
    rank[i] = 1;
  }
}

int root(int x){
  if(x == par[x]) return x;
  return par[x] = root(par[x]);
}

int same(int x,int y){
  if(root(x) == root(y))
    return 1;
  return 0;
}

long long unite(int x,int y){
  x = root(x);
  y = root(y);
  if(x == y) return 0;

  if(rank[x] < rank[y]){
    par[x] = y;
    rank[y] += rank[x];
    return rank[x]*(rank[y]-rank[x]);
  }else{
    par[y] = x;
    rank[x] += rank[y];
    return rank[y]*(rank[x]-rank[y]);
  }
}

int main(void){
  long long N,M;
  scanf("%lld%lld",&N,&M);

  int A[M],B[M];
  for(int i = 0;i < M;i++){
    scanf("%d%d",&A[i],&B[i]);
    A[i]--; B[i]--;
  }

  init(N);
  long long ans[M];
  ans[M-1] = N*(N-1)/2;
  for(int i = M-1;i > 0;i--){
    ans[i-1] = ans[i]-unite(A[i],B[i]);
  }

  for(int i = 0;i < M;i++){
    printf("%lld\n",ans[i]);
  }

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	par
	.bss
	.align 32
	.type	par, @object
	.size	par, 400000
par:
	.zero	400000
	.globl	rank
	.align 32
	.type	rank, @object
	.size	rank, 800000
rank:
	.zero	800000
	.text
	.globl	init
	.type	init, @function
init:
.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, -20(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L2
.L3:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	par(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	rank(%rip), %rax
	movq	$1, (%rdx,%rax)
	addl	$1, -4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L3
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	init, .-init
	.globl	root
	.type	root, @function
root:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	par(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	jne	.L5
	movl	-4(%rbp), %eax
	jmp	.L6
.L5:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	par(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %edi
	call	root
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	par(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	par(%rip), %rax
	movl	(%rdx,%rax), %eax
.L6:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	root, .-root
	.globl	same
	.type	same, @function
same:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 3, -24
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	root
	movl	%eax, %ebx
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	call	root
	cmpl	%eax, %ebx
	jne	.L8
	movl	$1, %eax
	jmp	.L9
.L8:
	movl	$0, %eax
.L9:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	same, .-same
	.globl	unite
	.type	unite, @function
unite:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	root
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, %edi
	call	root
	movl	%eax, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jne	.L11
	movl	$0, %eax
	jmp	.L12
.L11:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	rank(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	rank(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	jge	.L13
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	par(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	rank(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	rank(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	rank(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	rank(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	-8(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	rank(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	movl	-4(%rbp), %ecx
	movslq	%ecx, %rcx
	leaq	0(,%rcx,8), %rsi
	leaq	rank(%rip), %rcx
	movq	(%rsi,%rcx), %rcx
	subq	%rcx, %rdx
	imulq	%rdx, %rax
	jmp	.L12
.L13:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	par(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	rank(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	rank(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	rank(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	rank(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	rank(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	movl	-8(%rbp), %ecx
	movslq	%ecx, %rcx
	leaq	0(,%rcx,8), %rsi
	leaq	rank(%rip), %rcx
	movq	(%rsi,%rcx), %rcx
	subq	%rcx, %rdx
	imulq	%rdx, %rax
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	unite, .-unite
	.section	.rodata
.LC0:
	.string	"%lld%lld"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	subq	$176, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 12, -40
	.cfi_offset 3, -48
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %r12
	leaq	-96(%rbp), %rax
	leaq	-104(%rbp), %rcx
	movq	%rax, %rdx
	movq	%rcx, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-96(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -88(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -144(%rbp)
	movq	$0, -136(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -160(%rbp)
	movq	$0, -152(%rbp)
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L15:
	cmpq	%rdx, %rsp
	je	.L16
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L15
.L16:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L17
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L17:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -80(%rbp)
	movq	-96(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -72(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -176(%rbp)
	movq	$0, -168(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -192(%rbp)
	movq	$0, -184(%rbp)
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L18:
	cmpq	%rdx, %rsp
	je	.L19
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L18
.L19:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L20
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L20:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -116(%rbp)
	jmp	.L21
.L22:
	movl	-116(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-64(%rbp), %rax
	addq	%rax, %rdx
	movl	-116(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-80(%rbp), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-80(%rbp), %rax
	movl	-116(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	leal	-1(%rax), %ecx
	movq	-80(%rbp), %rax
	movl	-116(%rbp), %edx
	movslq	%edx, %rdx
	movl	%ecx, (%rax,%rdx,4)
	movq	-64(%rbp), %rax
	movl	-116(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	leal	-1(%rax), %ecx
	movq	-64(%rbp), %rax
	movl	-116(%rbp), %edx
	movslq	%edx, %rdx
	movl	%ecx, (%rax,%rdx,4)
	addl	$1, -116(%rbp)
.L21:
	movl	-116(%rbp), %eax
	movslq	%eax, %rdx
	movq	-96(%rbp), %rax
	cmpq	%rax, %rdx
	jl	.L22
	movq	-104(%rbp), %rax
	movl	%eax, %edi
	call	init
	movq	-96(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -56(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -208(%rbp)
	movq	$0, -200(%rbp)
	movq	%rax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L23:
	cmpq	%rdx, %rsp
	je	.L24
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L23
.L24:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L25
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L25:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -48(%rbp)
	movq	-104(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	-104(%rbp), %rax
	imulq	%rdx, %rax
	movq	-96(%rbp), %rdx
	subq	$1, %rdx
	movq	%rax, %rcx
	shrq	$63, %rcx
	addq	%rcx, %rax
	sarq	%rax
	movq	%rax, %rcx
	movq	-48(%rbp), %rax
	movq	%rcx, (%rax,%rdx,8)
	movq	-96(%rbp), %rax
	subl	$1, %eax
	movl	%eax, -112(%rbp)
	jmp	.L26
.L27:
	movq	-48(%rbp), %rax
	movl	-112(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rbx
	movq	-64(%rbp), %rax
	movl	-112(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movq	-80(%rbp), %rax
	movl	-112(%rbp), %ecx
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,4), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	unite
	movq	%rax, %rsi
	movl	-112(%rbp), %eax
	leal	-1(%rax), %edx
	subq	%rsi, %rbx
	movq	%rbx, %rcx
	movq	-48(%rbp), %rax
	movslq	%edx, %rdx
	movq	%rcx, (%rax,%rdx,8)
	subl	$1, -112(%rbp)
.L26:
	cmpl	$0, -112(%rbp)
	jg	.L27
	movl	$0, -108(%rbp)
	jmp	.L28
.L29:
	movq	-48(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -108(%rbp)
.L28:
	movl	-108(%rbp), %eax
	movslq	%eax, %rdx
	movq	-96(%rbp), %rax
	cmpq	%rax, %rdx
	jl	.L29
	movl	$0, %eax
	movq	%r12, %rsp
	movq	-40(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	leaq	-32(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.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	par
	.bss
	.align 32
	.type	par, @object
	.size	par, 400000
par:
	.zero	400000
	.globl	rank
	.align 32
	.type	rank, @object
	.size	rank, 800000
rank:
	.zero	800000
	.text
	.globl	init
	.type	init, @function
init:
.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, -20(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L2
.L3:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	par(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	rank(%rip), %rax
	movq	$1, (%rdx,%rax)
	addl	$1, -4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L3
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	init, .-init
	.globl	root
	.type	root, @function
root:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	par(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	jne	.L5
	movl	-4(%rbp), %eax
	jmp	.L6
.L5:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	par(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %edi
	call	root
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	par(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	par(%rip), %rax
	movl	(%rdx,%rax), %eax
.L6:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	root, .-root
	.globl	same
	.type	same, @function
same:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 3, -24
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	root
	movl	%eax, %ebx
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	call	root
	cmpl	%eax, %ebx
	jne	.L8
	movl	$1, %eax
	jmp	.L9
.L8:
	movl	$0, %eax
.L9:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	same, .-same
	.globl	unite
	.type	unite, @function
unite:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	root
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, %edi
	call	root
	movl	%eax, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jne	.L11
	movl	$0, %eax
	jmp	.L12
.L11:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	rank(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	rank(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	jge	.L13
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	par(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	rank(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	rank(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	rank(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	rank(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	-8(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	rank(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	movl	-4(%rbp), %ecx
	movslq	%ecx, %rcx
	leaq	0(,%rcx,8), %rsi
	leaq	rank(%rip), %rcx
	movq	(%rsi,%rcx), %rcx
	subq	%rcx, %rdx
	imulq	%rdx, %rax
	jmp	.L12
.L13:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	par(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	rank(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	rank(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	rank(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	rank(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	rank(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	movl	-8(%rbp), %ecx
	movslq	%ecx, %rcx
	leaq	0(,%rcx,8), %rsi
	leaq	rank(%rip), %rcx
	movq	(%rsi,%rcx), %rcx
	subq	%rcx, %rdx
	imulq	%rdx, %rax
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	unite, .-unite
	.section	.rodata
.LC0:
	.string	"%lld%lld"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	subq	$176, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 12, -40
	.cfi_offset 3, -48
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %r12
	leaq	-96(%rbp), %rax
	leaq	-104(%rbp), %rcx
	movq	%rax, %rdx
	movq	%rcx, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-96(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -88(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -144(%rbp)
	movq	$0, -136(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -160(%rbp)
	movq	$0, -152(%rbp)
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L15:
	cmpq	%rdx, %rsp
	je	.L16
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L15
.L16:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L17
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L17:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -80(%rbp)
	movq	-96(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -72(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -176(%rbp)
	movq	$0, -168(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -192(%rbp)
	movq	$0, -184(%rbp)
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L18:
	cmpq	%rdx, %rsp
	je	.L19
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L18
.L19:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L20
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L20:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -116(%rbp)
	jmp	.L21
.L22:
	movl	-116(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-64(%rbp), %rax
	addq	%rax, %rdx
	movl	-116(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-80(%rbp), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-80(%rbp), %rax
	movl	-116(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	leal	-1(%rax), %ecx
	movq	-80(%rbp), %rax
	movl	-116(%rbp), %edx
	movslq	%edx, %rdx
	movl	%ecx, (%rax,%rdx,4)
	movq	-64(%rbp), %rax
	movl	-116(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	leal	-1(%rax), %ecx
	movq	-64(%rbp), %rax
	movl	-116(%rbp), %edx
	movslq	%edx, %rdx
	movl	%ecx, (%rax,%rdx,4)
	addl	$1, -116(%rbp)
.L21:
	movl	-116(%rbp), %eax
	movslq	%eax, %rdx
	movq	-96(%rbp), %rax
	cmpq	%rax, %rdx
	jl	.L22
	movq	-104(%rbp), %rax
	movl	%eax, %edi
	call	init
	movq	-96(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -56(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -208(%rbp)
	movq	$0, -200(%rbp)
	movq	%rax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L23:
	cmpq	%rdx, %rsp
	je	.L24
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L23
.L24:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L25
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L25:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -48(%rbp)
	movq	-104(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	-104(%rbp), %rax
	imulq	%rdx, %rax
	movq	-96(%rbp), %rdx
	subq	$1, %rdx
	movq	%rax, %rcx
	shrq	$63, %rcx
	addq	%rcx, %rax
	sarq	%rax
	movq	%rax, %rcx
	movq	-48(%rbp), %rax
	movq	%rcx, (%rax,%rdx,8)
	movq	-96(%rbp), %rax
	subl	$1, %eax
	movl	%eax, -112(%rbp)
	jmp	.L26
.L27:
	movq	-48(%rbp), %rax
	movl	-112(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rbx
	movq	-64(%rbp), %rax
	movl	-112(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movq	-80(%rbp), %rax
	movl	-112(%rbp), %ecx
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,4), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	unite
	movq	%rax, %rsi
	movl	-112(%rbp), %eax
	leal	-1(%rax), %edx
	subq	%rsi, %rbx
	movq	%rbx, %rcx
	movq	-48(%rbp), %rax
	movslq	%edx, %rdx
	movq	%rcx, (%rax,%rdx,8)
	subl	$1, -112(%rbp)
.L26:
	cmpl	$0, -112(%rbp)
	jg	.L27
	movl	$0, -108(%rbp)
	jmp	.L28
.L29:
	movq	-48(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -108(%rbp)
.L28:
	movl	-108(%rbp), %eax
	movslq	%eax, %rdx
	movq	-96(%rbp), %rax
	cmpq	%rax, %rdx
	jl	.L29
	movl	$0, %eax
	movq	%r12, %rsp
	movq	-40(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	leaq	-32(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.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:
