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 MAX 10001

 int par[MAX],rank[MAX];

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

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

 int unite(int x,int y){
               x=find(x);
               y=find(y);

               if(x==y)return;

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


 int same(int x,int y){return find(x)==find(y);}

 int main(){
        int n,q,com,i,x,y;
        scanf("%d%d",&n,&q);
        init(n);
        for(i=0;i<q;i++){
                    scanf("%d%d%d",&com,&x,&y);

                    if(com==0){unite(x,y);}
                    else 
                          {if(same(x,y)){printf("1\n");}
                           else {printf("0\n");}
                          }
                    }
        return 0;
        }

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	par
	.bss
	.align 32
	.type	par, @object
	.size	par, 40004
par:
	.zero	40004
	.globl	rank
	.align 32
	.type	rank, @object
	.size	rank, 40004
rank:
	.zero	40004
	.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,4), %rdx
	leaq	rank(%rip), %rax
	movl	$0, (%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	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	$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
	movl	$0, %eax
	call	find
	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	find, .-find
	.globl	unite
	.type	unite, @function
unite:
.LFB2:
	.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
	movl	$0, %eax
	call	find
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, %edi
	movl	$0, %eax
	call	find
	movl	%eax, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	je	.L11
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	rank(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	rank(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L10
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	par(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L9
.L10:
	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,4), %rdx
	leaq	rank(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	rank(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jne	.L9
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	rank(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	rank(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L9
.L11:
	nop
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	unite, .-unite
	.globl	same
	.type	same, @function
same:
.LFB3:
	.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
	movl	$0, %eax
	call	find
	movl	%eax, %ebx
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	movl	$0, %eax
	call	find
	cmpl	%eax, %ebx
	sete	%al
	movzbl	%al, %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	same, .-same
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d%d%d"
.LC2:
	.string	"1"
.LC3:
	.string	"0"
	.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
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	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
	movl	%eax, %edi
	call	init
	movl	$0, -12(%rbp)
	jmp	.L15
.L19:
	leaq	-16(%rbp), %rcx
	leaq	-20(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	testl	%eax, %eax
	jne	.L16
	movl	-16(%rbp), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	unite
	jmp	.L17
.L16:
	movl	-16(%rbp), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	same
	testl	%eax, %eax
	je	.L18
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L17
.L18:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L17:
	addl	$1, -12(%rbp)
.L15:
	movl	-28(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L19
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leave
	.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
	testl	%edi, %edi
	jle	.L1
	leal	-1(%rdi), %eax
	cmpl	$2, %eax
	jbe	.L6
	movl	%edi, %edx
	leaq	par(%rip), %rcx
	movdqa	.LC0(%rip), %xmm0
	movdqa	.LC1(%rip), %xmm2
	shrl	$2, %edx
	leaq	16(%rcx), %rsi
	movq	%rcx, %rax
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rsi, %rdx
	.p2align 4,,10
	.p2align 3
.L4:
	movdqa	%xmm0, %xmm1
	addq	$16, %rax
	paddd	%xmm2, %xmm0
	movaps	%xmm1, -16(%rax)
	cmpq	%rdx, %rax
	jne	.L4
	movl	%edi, %eax
	andl	$-4, %eax
	testb	$3, %dil
	je	.L5
.L3:
	movslq	%eax, %rdx
	movl	%eax, (%rcx,%rdx,4)
	leal	1(%rax), %edx
	cmpl	%edx, %edi
	jle	.L5
	movslq	%edx, %rsi
	addl	$2, %eax
	movl	%edx, (%rcx,%rsi,4)
	cmpl	%eax, %edi
	jle	.L5
	movslq	%eax, %rdx
	movl	%eax, (%rcx,%rdx,4)
.L5:
	movl	%edi, %edi
	xorl	%esi, %esi
	leaq	0(,%rdi,4), %rdx
	leaq	rank(%rip), %rdi
	jmp	memset@PLT
	.p2align 4,,10
	.p2align 3
.L1:
	ret
.L6:
	xorl	%eax, %eax
	leaq	par(%rip), %rcx
	jmp	.L3
	.cfi_endproc
.LFE23:
	.size	init, .-init
	.p2align 4
	.globl	find
	.type	find, @function
find:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movslq	%edi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	par(%rip), %rbx
	movq	%rbp, %rax
	movl	(%rbx,%rbp,4), %edx
	cmpl	%ebp, %edx
	jne	.L16
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	movslq	%edx, %r12
	movl	(%rbx,%r12,4), %eax
	cmpl	%eax, %edx
	je	.L11
	movslq	%eax, %r13
	movl	(%rbx,%r13,4), %edx
	cmpl	%edx, %eax
	jne	.L17
.L12:
	movl	%edx, (%rbx,%r12,4)
	movl	%edx, %eax
.L11:
	movl	%eax, (%rbx,%rbp,4)
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	movslq	%edx, %r14
	movl	(%rbx,%r14,4), %edi
	cmpl	%edi, %edx
	je	.L13
	xorl	%eax, %eax
	call	find
	movl	%eax, (%rbx,%r14,4)
	movl	%eax, %edi
.L13:
	movl	%edi, (%rbx,%r13,4)
	movl	%edi, %edx
	jmp	.L12
	.cfi_endproc
.LFE24:
	.size	find, .-find
	.p2align 4
	.globl	unite
	.type	unite, @function
unite:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	par(%rip), %rcx
	movslq	%edi, %r9
	movl	%esi, %r8d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movl	(%rcx,%r9,4), %esi
	cmpl	%esi, %edi
	jne	.L44
.L19:
	movslq	%r8d, %r9
	movl	(%rcx,%r9,4), %eax
	cmpl	%eax, %r8d
	jne	.L45
.L27:
	cmpl	%esi, %eax
	je	.L39
	leaq	rank(%rip), %rdx
	movslq	%esi, %rdi
	movslq	%eax, %r9
	movl	(%rdx,%rdi,4), %r8d
	cmpl	(%rdx,%r9,4), %r8d
	jge	.L40
	movl	%eax, (%rcx,%rdi,4)
.L39:
	addq	$24, %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
.L40:
	.cfi_restore_state
	movl	%esi, (%rcx,%r9,4)
	jne	.L39
	addl	$1, %r8d
	movl	%r8d, (%rdx,%rdi,4)
	addq	$24, %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
.L45:
	.cfi_restore_state
	movslq	%eax, %r8
	movl	(%rcx,%r8,4), %edx
	cmpl	%edx, %eax
	je	.L28
	movslq	%edx, %r10
	movl	(%rcx,%r10,4), %eax
	cmpl	%eax, %edx
	jne	.L46
.L29:
	movl	%eax, (%rcx,%r8,4)
	movl	%eax, %edx
.L28:
	movl	%edx, (%rcx,%r9,4)
	movl	%edx, %eax
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L44:
	movslq	%esi, %r10
	movl	(%rcx,%r10,4), %eax
	cmpl	%eax, %esi
	je	.L20
	movslq	%eax, %rsi
	movl	(%rcx,%rsi,4), %edx
	cmpl	%edx, %eax
	jne	.L47
.L21:
	movl	%edx, (%rcx,%r10,4)
	movl	%edx, %eax
.L20:
	movl	%eax, (%rcx,%r9,4)
	movl	%eax, %esi
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L47:
	movslq	%edx, %r11
	movl	(%rcx,%r11,4), %eax
	cmpl	%eax, %edx
	je	.L22
	movslq	%eax, %rbx
	movl	(%rcx,%rbx,4), %edx
	cmpl	%edx, %eax
	jne	.L48
.L23:
	movl	%edx, (%rcx,%r11,4)
	movl	%edx, %eax
.L22:
	movl	%eax, (%rcx,%rsi,4)
	movl	%eax, %edx
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L46:
	movslq	%eax, %r11
	movl	(%rcx,%r11,4), %edx
	cmpl	%edx, %eax
	je	.L30
	movslq	%edx, %rbx
	movl	(%rcx,%rbx,4), %eax
	cmpl	%eax, %edx
	jne	.L49
.L31:
	movl	%eax, (%rcx,%r11,4)
	movl	%eax, %edx
.L30:
	movl	%edx, (%rcx,%r10,4)
	movl	%edx, %eax
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L49:
	movslq	%eax, %rbp
	movl	(%rcx,%rbp,4), %edx
	cmpl	%edx, %eax
	je	.L32
	movslq	%edx, %r12
	movl	(%rcx,%r12,4), %eax
	cmpl	%eax, %edx
	je	.L33
	movslq	%eax, %r13
	movl	(%rcx,%r13,4), %edx
	cmpl	%edx, %eax
	je	.L34
	movslq	%edx, %r14
	movl	(%rcx,%r14,4), %eax
	cmpl	%eax, %edx
	je	.L35
	movslq	%eax, %r15
	movl	(%rcx,%r15,4), %edi
	cmpl	%edi, %eax
	je	.L42
	movslq	%edi, %rdx
	movl	(%rcx,%rdx,4), %eax
	movq	%rdx, 8(%rsp)
	cmpl	%eax, %edi
	je	.L37
	movl	%eax, %edi
	xorl	%eax, %eax
	call	find
	movq	8(%rsp), %rdx
	movl	%eax, (%rcx,%rdx,4)
.L37:
	movl	%eax, (%rcx,%r15,4)
.L36:
	movl	%eax, (%rcx,%r14,4)
.L35:
	movl	%eax, (%rcx,%r13,4)
	movl	%eax, %edx
.L34:
	movl	%edx, (%rcx,%r12,4)
	movl	%edx, %eax
.L33:
	movl	%eax, (%rcx,%rbp,4)
	movl	%eax, %edx
.L32:
	movl	%edx, (%rcx,%rbx,4)
	movl	%edx, %eax
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L48:
	movslq	%edx, %rbp
	movl	(%rcx,%rbp,4), %eax
	cmpl	%eax, %edx
	je	.L24
	movslq	%eax, %r12
	movl	(%rcx,%r12,4), %edx
	cmpl	%edx, %eax
	je	.L25
	movslq	%edx, %r13
	movl	(%rcx,%r13,4), %edi
	cmpl	%edi, %edx
	je	.L26
	xorl	%eax, %eax
	call	find
	movl	%eax, (%rcx,%r13,4)
	movl	%eax, %edi
.L26:
	movl	%edi, (%rcx,%r12,4)
	movl	%edi, %edx
.L25:
	movl	%edx, (%rcx,%rbp,4)
	movl	%edx, %eax
.L24:
	movl	%eax, (%rcx,%rbx,4)
	movl	%eax, %edx
	jmp	.L23
.L42:
	movl	%edi, %eax
	jmp	.L36
	.cfi_endproc
.LFE25:
	.size	unite, .-unite
	.p2align 4
	.globl	same
	.type	same, @function
same:
.LFB26:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	par(%rip), %rcx
	movslq	%edi, %r8
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	movl	(%rcx,%r8,4), %r9d
	cmpl	%r9d, %edi
	jne	.L68
	movslq	%esi, %r8
	movl	(%rcx,%r8,4), %eax
	cmpl	%eax, %esi
	jne	.L69
.L59:
	cmpl	%r9d, %eax
	sete	%al
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	movzbl	%al, %eax
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L68:
	.cfi_restore_state
	movslq	%r9d, %r10
	movl	(%rcx,%r10,4), %eax
	cmpl	%eax, %r9d
	je	.L52
	movslq	%eax, %r9
	movl	(%rcx,%r9,4), %edx
	cmpl	%edx, %eax
	jne	.L70
.L53:
	movl	%edx, (%rcx,%r10,4)
	movl	%edx, %eax
.L52:
	movl	%eax, (%rcx,%r8,4)
	movslq	%esi, %r8
	movl	%eax, %r9d
	movl	(%rcx,%r8,4), %eax
	cmpl	%eax, %esi
	je	.L59
.L69:
	movslq	%eax, %rsi
	movl	(%rcx,%rsi,4), %edx
	cmpl	%edx, %eax
	je	.L60
	movslq	%edx, %r10
	movl	(%rcx,%r10,4), %eax
	cmpl	%eax, %edx
	jne	.L71
.L61:
	movl	%eax, (%rcx,%rsi,4)
	movl	%eax, %edx
.L60:
	movl	%edx, (%rcx,%r8,4)
	movl	%edx, %eax
	jmp	.L59
	.p2align 4,,10
	.p2align 3
.L71:
	movslq	%eax, %r11
	movl	(%rcx,%r11,4), %edx
	cmpl	%edx, %eax
	je	.L62
	movslq	%edx, %rbx
	movl	(%rcx,%rbx,4), %eax
	cmpl	%eax, %edx
	jne	.L72
.L63:
	movl	%eax, (%rcx,%r11,4)
	movl	%eax, %edx
.L62:
	movl	%edx, (%rcx,%r10,4)
	movl	%edx, %eax
	jmp	.L61
	.p2align 4,,10
	.p2align 3
.L70:
	movslq	%edx, %r11
	movl	(%rcx,%r11,4), %eax
	cmpl	%eax, %edx
	je	.L54
	movslq	%eax, %rbx
	movl	(%rcx,%rbx,4), %edx
	cmpl	%edx, %eax
	jne	.L73
.L55:
	movl	%edx, (%rcx,%r11,4)
	movl	%edx, %eax
.L54:
	movl	%eax, (%rcx,%r9,4)
	movl	%eax, %edx
	jmp	.L53
	.p2align 4,,10
	.p2align 3
.L73:
	movslq	%edx, %rbp
	movl	(%rcx,%rbp,4), %eax
	cmpl	%eax, %edx
	je	.L56
	movslq	%eax, %r12
	movl	(%rcx,%r12,4), %edx
	cmpl	%edx, %eax
	je	.L57
	movslq	%edx, %r13
	movl	(%rcx,%r13,4), %edi
	cmpl	%edi, %edx
	je	.L58
	xorl	%eax, %eax
	call	find
	movl	%eax, (%rcx,%r13,4)
	movl	%eax, %edi
.L58:
	movl	%edi, (%rcx,%r12,4)
	movl	%edi, %edx
.L57:
	movl	%edx, (%rcx,%rbp,4)
	movl	%edx, %eax
.L56:
	movl	%eax, (%rcx,%rbx,4)
	movl	%eax, %edx
	jmp	.L55
	.p2align 4,,10
	.p2align 3
.L72:
	movslq	%eax, %rbp
	movl	(%rcx,%rbp,4), %edx
	cmpl	%edx, %eax
	je	.L64
	movslq	%edx, %r12
	movl	(%rcx,%r12,4), %edi
	cmpl	%edi, %edx
	je	.L65
	movslq	%edi, %r13
	movl	(%rcx,%r13,4), %eax
	cmpl	%eax, %edi
	je	.L66
	movl	%eax, %edi
	xorl	%eax, %eax
	call	find
	movl	%eax, (%rcx,%r13,4)
.L66:
	movl	%eax, (%rcx,%r12,4)
	movl	%eax, %edi
.L65:
	movl	%edi, (%rcx,%rbp,4)
	movl	%edi, %edx
.L64:
	movl	%edx, (%rcx,%rbx,4)
	movl	%edx, %eax
	jmp	.L63
	.cfi_endproc
.LFE26:
	.size	same, .-same
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"%d%d"
.LC3:
	.string	"%d%d%d"
.LC4:
	.string	"1"
.LC5:
	.string	"0"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB27:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC2(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rdx
	leaq	36(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %edx
	testl	%edx, %edx
	jle	.L75
	leal	-1(%rdx), %eax
	cmpl	$2, %eax
	jbe	.L103
	movl	%edx, %ecx
	leaq	par(%rip), %rsi
	movdqa	.LC0(%rip), %xmm0
	movdqa	.LC1(%rip), %xmm2
	shrl	$2, %ecx
	leaq	16(%rsi), %rdi
	movq	%rsi, %rax
	subl	$1, %ecx
	salq	$4, %rcx
	addq	%rdi, %rcx
	.p2align 4,,10
	.p2align 3
.L77:
	movdqa	%xmm0, %xmm1
	addq	$16, %rax
	paddd	%xmm2, %xmm0
	movaps	%xmm1, -16(%rax)
	cmpq	%rcx, %rax
	jne	.L77
	movl	%edx, %eax
	andl	$-4, %eax
	testb	$3, %dl
	je	.L78
.L76:
	movslq	%eax, %rcx
	movl	%eax, (%rsi,%rcx,4)
	leal	1(%rax), %ecx
	cmpl	%ecx, %edx
	jle	.L78
	movslq	%ecx, %rdi
	addl	$2, %eax
	movl	%ecx, (%rsi,%rdi,4)
	cmpl	%eax, %edx
	jle	.L78
	movslq	%eax, %rcx
	movl	%eax, (%rsi,%rcx,4)
.L78:
	salq	$2, %rdx
	xorl	%esi, %esi
	leaq	rank(%rip), %rdi
	call	memset@PLT
.L75:
	movl	40(%rsp), %edx
	testl	%edx, %edx
	jle	.L79
	xorl	%ebx, %ebx
	leaq	52(%rsp), %r14
	leaq	48(%rsp), %r13
	leaq	44(%rsp), %r12
	leaq	.LC3(%rip), %r15
	leaq	par(%rip), %rbp
	jmp	.L101
	.p2align 4,,10
	.p2align 3
.L109:
	movl	52(%rsp), %esi
	movl	48(%rsp), %edi
	call	unite
.L81:
	addl	$1, %ebx
	cmpl	%ebx, 40(%rsp)
	jle	.L79
.L101:
	movq	%r14, %rcx
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	testl	%eax, %eax
	je	.L109
	movslq	48(%rsp), %rsi
	movl	52(%rsp), %ecx
	movl	0(%rbp,%rsi,4), %r9d
	cmpl	%r9d, %esi
	je	.L82
	movslq	%r9d, %r8
	movl	0(%rbp,%r8,4), %eax
	cmpl	%eax, %r9d
	je	.L83
	movslq	%eax, %r9
	movl	0(%rbp,%r9,4), %edx
	cmpl	%edx, %eax
	jne	.L110
.L84:
	movl	%eax, 0(%rbp,%r8,4)
.L83:
	movl	%eax, 0(%rbp,%rsi,4)
	movl	%eax, %r9d
.L82:
	movslq	%ecx, %rsi
	movl	0(%rbp,%rsi,4), %eax
	cmpl	%eax, %ecx
	je	.L91
	movslq	%eax, %rcx
	movl	0(%rbp,%rcx,4), %edx
	cmpl	%edx, %eax
	je	.L92
	movslq	%edx, %r8
	movl	0(%rbp,%r8,4), %eax
	cmpl	%eax, %edx
	jne	.L111
.L93:
	movl	%edx, 0(%rbp,%rcx,4)
.L92:
	movl	%edx, 0(%rbp,%rsi,4)
	movl	%edx, %eax
.L91:
	cmpl	%r9d, %eax
	jne	.L100
	leaq	.LC4(%rip), %rdi
	addl	$1, %ebx
	call	puts@PLT
	cmpl	%ebx, 40(%rsp)
	jg	.L101
.L79:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L112
	addq	$72, %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
.L100:
	.cfi_restore_state
	leaq	.LC5(%rip), %rdi
	call	puts@PLT
	jmp	.L81
.L111:
	movslq	%eax, %r10
	movl	0(%rbp,%r10,4), %edx
	cmpl	%edx, %eax
	je	.L94
	movslq	%edx, %r11
	movl	0(%rbp,%r11,4), %eax
	cmpl	%eax, %edx
	jne	.L113
.L95:
	movl	%eax, 0(%rbp,%r10,4)
	movl	%eax, %edx
.L94:
	movl	%edx, 0(%rbp,%r8,4)
	jmp	.L93
.L110:
	movslq	%edx, %r10
	movl	0(%rbp,%r10,4), %eax
	cmpl	%eax, %edx
	je	.L85
	movslq	%eax, %r11
	movl	0(%rbp,%r11,4), %edi
	cmpl	%edi, %eax
	jne	.L114
.L86:
	movl	%edi, 0(%rbp,%r10,4)
	movl	%edi, %eax
.L85:
	movl	%eax, 0(%rbp,%r9,4)
	jmp	.L84
.L114:
	movslq	%edi, %rdx
	movl	0(%rbp,%rdx,4), %eax
	cmpl	%eax, %edi
	je	.L87
	movslq	%eax, %rdi
	movq	%rdi, (%rsp)
	movl	0(%rbp,%rdi,4), %edi
	cmpl	%edi, %eax
	jne	.L115
.L88:
	movl	%edi, 0(%rbp,%rdx,4)
	movl	%edi, %eax
.L87:
	movl	%eax, 0(%rbp,%r11,4)
	movl	%eax, %edi
	jmp	.L86
.L113:
	movslq	%eax, %rdx
	movl	0(%rbp,%rdx,4), %edi
	cmpl	%edi, %eax
	je	.L96
	movslq	%edi, %rax
	movq	%rax, (%rsp)
	movl	0(%rbp,%rax,4), %eax
	cmpl	%eax, %edi
	jne	.L116
.L97:
	movl	%eax, 0(%rbp,%rdx,4)
	movl	%eax, %edi
.L96:
	movl	%edi, 0(%rbp,%r11,4)
	movl	%edi, %eax
	jmp	.L95
.L103:
	xorl	%eax, %eax
	leaq	par(%rip), %rsi
	jmp	.L76
.L116:
	movslq	%eax, %rdi
	movq	%rdi, 8(%rsp)
	movl	0(%rbp,%rdi,4), %edi
	cmpl	%edi, %eax
	je	.L98
	movslq	%edi, %rax
	movq	%rax, 16(%rsp)
	movl	0(%rbp,%rax,4), %eax
	cmpl	%eax, %edi
	je	.L99
	movl	%eax, %edi
	xorl	%eax, %eax
	movq	%rdx, 24(%rsp)
	call	find
	movq	16(%rsp), %rdi
	movq	24(%rsp), %rdx
	movl	%eax, 0(%rbp,%rdi,4)
.L99:
	movq	8(%rsp), %rdi
	movl	%eax, 0(%rbp,%rdi,4)
	movl	%eax, %edi
.L98:
	movq	(%rsp), %rax
	movl	%edi, 0(%rbp,%rax,4)
	movl	%edi, %eax
	jmp	.L97
.L115:
	movslq	%edi, %rax
	movq	%rax, 8(%rsp)
	movl	0(%rbp,%rax,4), %eax
	cmpl	%eax, %edi
	je	.L89
	movslq	%eax, %rdi
	movq	%rdi, 16(%rsp)
	movl	0(%rbp,%rdi,4), %edi
	cmpl	%edi, %eax
	je	.L90
	xorl	%eax, %eax
	movq	%rdx, 24(%rsp)
	call	find
	movq	24(%rsp), %rdx
	movl	%eax, %edi
	movq	16(%rsp), %rax
	movl	%edi, 0(%rbp,%rax,4)
.L90:
	movq	8(%rsp), %rax
	movl	%edi, 0(%rbp,%rax,4)
	movl	%edi, %eax
.L89:
	movq	(%rsp), %rdi
	movl	%eax, 0(%rbp,%rdi,4)
	movl	%eax, %edi
	jmp	.L88
.L112:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE27:
	.size	main, .-main
	.globl	rank
	.bss
	.align 32
	.type	rank, @object
	.size	rank, 40004
rank:
	.zero	40004
	.globl	par
	.align 32
	.type	par, @object
	.size	par, 40004
par:
	.zero	40004
	.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
	.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
	testl	%edi, %edi
	jle	.L1
	leal	-1(%rdi), %eax
	cmpl	$2, %eax
	jbe	.L6
	movl	%edi, %edx
	leaq	par(%rip), %rcx
	movdqa	.LC0(%rip), %xmm0
	movdqa	.LC1(%rip), %xmm2
	shrl	$2, %edx
	leaq	16(%rcx), %rsi
	movq	%rcx, %rax
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rsi, %rdx
	.p2align 4,,10
	.p2align 3
.L4:
	movdqa	%xmm0, %xmm1
	addq	$16, %rax
	paddd	%xmm2, %xmm0
	movaps	%xmm1, -16(%rax)
	cmpq	%rdx, %rax
	jne	.L4
	movl	%edi, %eax
	andl	$-4, %eax
	testb	$3, %dil
	je	.L5
.L3:
	movslq	%eax, %rdx
	movl	%eax, (%rcx,%rdx,4)
	leal	1(%rax), %edx
	cmpl	%edx, %edi
	jle	.L5
	movslq	%edx, %rsi
	addl	$2, %eax
	movl	%edx, (%rcx,%rsi,4)
	cmpl	%eax, %edi
	jle	.L5
	movslq	%eax, %rdx
	movl	%eax, (%rcx,%rdx,4)
.L5:
	movl	%edi, %edi
	xorl	%esi, %esi
	leaq	0(,%rdi,4), %rdx
	leaq	rank(%rip), %rdi
	jmp	memset@PLT
	.p2align 4,,10
	.p2align 3
.L1:
	ret
.L6:
	xorl	%eax, %eax
	leaq	par(%rip), %rcx
	jmp	.L3
	.cfi_endproc
.LFE23:
	.size	init, .-init
	.p2align 4
	.globl	find
	.type	find, @function
find:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movslq	%edi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	par(%rip), %rbx
	movq	%rbp, %rax
	movl	(%rbx,%rbp,4), %edx
	cmpl	%ebp, %edx
	jne	.L16
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	movslq	%edx, %r12
	movl	(%rbx,%r12,4), %eax
	cmpl	%eax, %edx
	je	.L11
	movslq	%eax, %r13
	movl	(%rbx,%r13,4), %edx
	cmpl	%edx, %eax
	jne	.L17
.L12:
	movl	%edx, (%rbx,%r12,4)
	movl	%edx, %eax
.L11:
	movl	%eax, (%rbx,%rbp,4)
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	movslq	%edx, %r14
	movl	(%rbx,%r14,4), %edi
	cmpl	%edi, %edx
	je	.L13
	xorl	%eax, %eax
	call	find
	movl	%eax, (%rbx,%r14,4)
	movl	%eax, %edi
.L13:
	movl	%edi, (%rbx,%r13,4)
	movl	%edi, %edx
	jmp	.L12
	.cfi_endproc
.LFE24:
	.size	find, .-find
	.p2align 4
	.globl	unite
	.type	unite, @function
unite:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	par(%rip), %rcx
	movslq	%edi, %r9
	movl	%esi, %r8d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movl	(%rcx,%r9,4), %esi
	cmpl	%esi, %edi
	jne	.L44
.L19:
	movslq	%r8d, %r9
	movl	(%rcx,%r9,4), %eax
	cmpl	%eax, %r8d
	jne	.L45
.L27:
	cmpl	%esi, %eax
	je	.L39
	leaq	rank(%rip), %rdx
	movslq	%esi, %rdi
	movslq	%eax, %r9
	movl	(%rdx,%rdi,4), %r8d
	cmpl	(%rdx,%r9,4), %r8d
	jge	.L40
	movl	%eax, (%rcx,%rdi,4)
.L39:
	addq	$24, %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
.L40:
	.cfi_restore_state
	movl	%esi, (%rcx,%r9,4)
	jne	.L39
	addl	$1, %r8d
	movl	%r8d, (%rdx,%rdi,4)
	addq	$24, %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
.L45:
	.cfi_restore_state
	movslq	%eax, %r8
	movl	(%rcx,%r8,4), %edx
	cmpl	%edx, %eax
	je	.L28
	movslq	%edx, %r10
	movl	(%rcx,%r10,4), %eax
	cmpl	%eax, %edx
	jne	.L46
.L29:
	movl	%eax, (%rcx,%r8,4)
	movl	%eax, %edx
.L28:
	movl	%edx, (%rcx,%r9,4)
	movl	%edx, %eax
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L44:
	movslq	%esi, %r10
	movl	(%rcx,%r10,4), %eax
	cmpl	%eax, %esi
	je	.L20
	movslq	%eax, %rsi
	movl	(%rcx,%rsi,4), %edx
	cmpl	%edx, %eax
	jne	.L47
.L21:
	movl	%edx, (%rcx,%r10,4)
	movl	%edx, %eax
.L20:
	movl	%eax, (%rcx,%r9,4)
	movl	%eax, %esi
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L47:
	movslq	%edx, %r11
	movl	(%rcx,%r11,4), %eax
	cmpl	%eax, %edx
	je	.L22
	movslq	%eax, %rbx
	movl	(%rcx,%rbx,4), %edx
	cmpl	%edx, %eax
	jne	.L48
.L23:
	movl	%edx, (%rcx,%r11,4)
	movl	%edx, %eax
.L22:
	movl	%eax, (%rcx,%rsi,4)
	movl	%eax, %edx
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L46:
	movslq	%eax, %r11
	movl	(%rcx,%r11,4), %edx
	cmpl	%edx, %eax
	je	.L30
	movslq	%edx, %rbx
	movl	(%rcx,%rbx,4), %eax
	cmpl	%eax, %edx
	jne	.L49
.L31:
	movl	%eax, (%rcx,%r11,4)
	movl	%eax, %edx
.L30:
	movl	%edx, (%rcx,%r10,4)
	movl	%edx, %eax
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L49:
	movslq	%eax, %rbp
	movl	(%rcx,%rbp,4), %edx
	cmpl	%edx, %eax
	je	.L32
	movslq	%edx, %r12
	movl	(%rcx,%r12,4), %eax
	cmpl	%eax, %edx
	je	.L33
	movslq	%eax, %r13
	movl	(%rcx,%r13,4), %edx
	cmpl	%edx, %eax
	je	.L34
	movslq	%edx, %r14
	movl	(%rcx,%r14,4), %eax
	cmpl	%eax, %edx
	je	.L35
	movslq	%eax, %r15
	movl	(%rcx,%r15,4), %edi
	cmpl	%edi, %eax
	je	.L42
	movslq	%edi, %rdx
	movl	(%rcx,%rdx,4), %eax
	movq	%rdx, 8(%rsp)
	cmpl	%eax, %edi
	je	.L37
	movl	%eax, %edi
	xorl	%eax, %eax
	call	find
	movq	8(%rsp), %rdx
	movl	%eax, (%rcx,%rdx,4)
.L37:
	movl	%eax, (%rcx,%r15,4)
.L36:
	movl	%eax, (%rcx,%r14,4)
.L35:
	movl	%eax, (%rcx,%r13,4)
	movl	%eax, %edx
.L34:
	movl	%edx, (%rcx,%r12,4)
	movl	%edx, %eax
.L33:
	movl	%eax, (%rcx,%rbp,4)
	movl	%eax, %edx
.L32:
	movl	%edx, (%rcx,%rbx,4)
	movl	%edx, %eax
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L48:
	movslq	%edx, %rbp
	movl	(%rcx,%rbp,4), %eax
	cmpl	%eax, %edx
	je	.L24
	movslq	%eax, %r12
	movl	(%rcx,%r12,4), %edx
	cmpl	%edx, %eax
	je	.L25
	movslq	%edx, %r13
	movl	(%rcx,%r13,4), %edi
	cmpl	%edi, %edx
	je	.L26
	xorl	%eax, %eax
	call	find
	movl	%eax, (%rcx,%r13,4)
	movl	%eax, %edi
.L26:
	movl	%edi, (%rcx,%r12,4)
	movl	%edi, %edx
.L25:
	movl	%edx, (%rcx,%rbp,4)
	movl	%edx, %eax
.L24:
	movl	%eax, (%rcx,%rbx,4)
	movl	%eax, %edx
	jmp	.L23
.L42:
	movl	%edi, %eax
	jmp	.L36
	.cfi_endproc
.LFE25:
	.size	unite, .-unite
	.p2align 4
	.globl	same
	.type	same, @function
same:
.LFB26:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	par(%rip), %rcx
	movslq	%edi, %r8
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	movl	(%rcx,%r8,4), %r9d
	cmpl	%r9d, %edi
	jne	.L68
	movslq	%esi, %r8
	movl	(%rcx,%r8,4), %eax
	cmpl	%eax, %esi
	jne	.L69
.L59:
	cmpl	%r9d, %eax
	sete	%al
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	movzbl	%al, %eax
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L68:
	.cfi_restore_state
	movslq	%r9d, %r10
	movl	(%rcx,%r10,4), %eax
	cmpl	%eax, %r9d
	je	.L52
	movslq	%eax, %r9
	movl	(%rcx,%r9,4), %edx
	cmpl	%edx, %eax
	jne	.L70
.L53:
	movl	%edx, (%rcx,%r10,4)
	movl	%edx, %eax
.L52:
	movl	%eax, (%rcx,%r8,4)
	movslq	%esi, %r8
	movl	%eax, %r9d
	movl	(%rcx,%r8,4), %eax
	cmpl	%eax, %esi
	je	.L59
.L69:
	movslq	%eax, %rsi
	movl	(%rcx,%rsi,4), %edx
	cmpl	%edx, %eax
	je	.L60
	movslq	%edx, %r10
	movl	(%rcx,%r10,4), %eax
	cmpl	%eax, %edx
	jne	.L71
.L61:
	movl	%eax, (%rcx,%rsi,4)
	movl	%eax, %edx
.L60:
	movl	%edx, (%rcx,%r8,4)
	movl	%edx, %eax
	jmp	.L59
	.p2align 4,,10
	.p2align 3
.L71:
	movslq	%eax, %r11
	movl	(%rcx,%r11,4), %edx
	cmpl	%edx, %eax
	je	.L62
	movslq	%edx, %rbx
	movl	(%rcx,%rbx,4), %eax
	cmpl	%eax, %edx
	jne	.L72
.L63:
	movl	%eax, (%rcx,%r11,4)
	movl	%eax, %edx
.L62:
	movl	%edx, (%rcx,%r10,4)
	movl	%edx, %eax
	jmp	.L61
	.p2align 4,,10
	.p2align 3
.L70:
	movslq	%edx, %r11
	movl	(%rcx,%r11,4), %eax
	cmpl	%eax, %edx
	je	.L54
	movslq	%eax, %rbx
	movl	(%rcx,%rbx,4), %edx
	cmpl	%edx, %eax
	jne	.L73
.L55:
	movl	%edx, (%rcx,%r11,4)
	movl	%edx, %eax
.L54:
	movl	%eax, (%rcx,%r9,4)
	movl	%eax, %edx
	jmp	.L53
	.p2align 4,,10
	.p2align 3
.L73:
	movslq	%edx, %rbp
	movl	(%rcx,%rbp,4), %eax
	cmpl	%eax, %edx
	je	.L56
	movslq	%eax, %r12
	movl	(%rcx,%r12,4), %edx
	cmpl	%edx, %eax
	je	.L57
	movslq	%edx, %r13
	movl	(%rcx,%r13,4), %edi
	cmpl	%edi, %edx
	je	.L58
	xorl	%eax, %eax
	call	find
	movl	%eax, (%rcx,%r13,4)
	movl	%eax, %edi
.L58:
	movl	%edi, (%rcx,%r12,4)
	movl	%edi, %edx
.L57:
	movl	%edx, (%rcx,%rbp,4)
	movl	%edx, %eax
.L56:
	movl	%eax, (%rcx,%rbx,4)
	movl	%eax, %edx
	jmp	.L55
	.p2align 4,,10
	.p2align 3
.L72:
	movslq	%eax, %rbp
	movl	(%rcx,%rbp,4), %edx
	cmpl	%edx, %eax
	je	.L64
	movslq	%edx, %r12
	movl	(%rcx,%r12,4), %edi
	cmpl	%edi, %edx
	je	.L65
	movslq	%edi, %r13
	movl	(%rcx,%r13,4), %eax
	cmpl	%eax, %edi
	je	.L66
	movl	%eax, %edi
	xorl	%eax, %eax
	call	find
	movl	%eax, (%rcx,%r13,4)
.L66:
	movl	%eax, (%rcx,%r12,4)
	movl	%eax, %edi
.L65:
	movl	%edi, (%rcx,%rbp,4)
	movl	%edi, %edx
.L64:
	movl	%edx, (%rcx,%rbx,4)
	movl	%edx, %eax
	jmp	.L63
	.cfi_endproc
.LFE26:
	.size	same, .-same
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"%d%d"
.LC3:
	.string	"%d%d%d"
.LC4:
	.string	"1"
.LC5:
	.string	"0"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB27:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC2(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rdx
	leaq	36(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %edx
	testl	%edx, %edx
	jle	.L75
	leal	-1(%rdx), %eax
	cmpl	$2, %eax
	jbe	.L103
	movl	%edx, %ecx
	leaq	par(%rip), %rsi
	movdqa	.LC0(%rip), %xmm0
	movdqa	.LC1(%rip), %xmm2
	shrl	$2, %ecx
	leaq	16(%rsi), %rdi
	movq	%rsi, %rax
	subl	$1, %ecx
	salq	$4, %rcx
	addq	%rdi, %rcx
	.p2align 4,,10
	.p2align 3
.L77:
	movdqa	%xmm0, %xmm1
	addq	$16, %rax
	paddd	%xmm2, %xmm0
	movaps	%xmm1, -16(%rax)
	cmpq	%rcx, %rax
	jne	.L77
	movl	%edx, %eax
	andl	$-4, %eax
	testb	$3, %dl
	je	.L78
.L76:
	movslq	%eax, %rcx
	movl	%eax, (%rsi,%rcx,4)
	leal	1(%rax), %ecx
	cmpl	%ecx, %edx
	jle	.L78
	movslq	%ecx, %rdi
	addl	$2, %eax
	movl	%ecx, (%rsi,%rdi,4)
	cmpl	%eax, %edx
	jle	.L78
	movslq	%eax, %rcx
	movl	%eax, (%rsi,%rcx,4)
.L78:
	salq	$2, %rdx
	xorl	%esi, %esi
	leaq	rank(%rip), %rdi
	call	memset@PLT
.L75:
	movl	40(%rsp), %edx
	testl	%edx, %edx
	jle	.L79
	xorl	%ebx, %ebx
	leaq	52(%rsp), %r14
	leaq	48(%rsp), %r13
	leaq	44(%rsp), %r12
	leaq	.LC3(%rip), %r15
	leaq	par(%rip), %rbp
	jmp	.L101
	.p2align 4,,10
	.p2align 3
.L109:
	movl	52(%rsp), %esi
	movl	48(%rsp), %edi
	call	unite
.L81:
	addl	$1, %ebx
	cmpl	%ebx, 40(%rsp)
	jle	.L79
.L101:
	movq	%r14, %rcx
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	testl	%eax, %eax
	je	.L109
	movslq	48(%rsp), %rsi
	movl	52(%rsp), %ecx
	movl	0(%rbp,%rsi,4), %r9d
	cmpl	%r9d, %esi
	je	.L82
	movslq	%r9d, %r8
	movl	0(%rbp,%r8,4), %eax
	cmpl	%eax, %r9d
	je	.L83
	movslq	%eax, %r9
	movl	0(%rbp,%r9,4), %edx
	cmpl	%edx, %eax
	jne	.L110
.L84:
	movl	%eax, 0(%rbp,%r8,4)
.L83:
	movl	%eax, 0(%rbp,%rsi,4)
	movl	%eax, %r9d
.L82:
	movslq	%ecx, %rsi
	movl	0(%rbp,%rsi,4), %eax
	cmpl	%eax, %ecx
	je	.L91
	movslq	%eax, %rcx
	movl	0(%rbp,%rcx,4), %edx
	cmpl	%edx, %eax
	je	.L92
	movslq	%edx, %r8
	movl	0(%rbp,%r8,4), %eax
	cmpl	%eax, %edx
	jne	.L111
.L93:
	movl	%edx, 0(%rbp,%rcx,4)
.L92:
	movl	%edx, 0(%rbp,%rsi,4)
	movl	%edx, %eax
.L91:
	cmpl	%r9d, %eax
	jne	.L100
	leaq	.LC4(%rip), %rdi
	addl	$1, %ebx
	call	puts@PLT
	cmpl	%ebx, 40(%rsp)
	jg	.L101
.L79:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L112
	addq	$72, %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
.L100:
	.cfi_restore_state
	leaq	.LC5(%rip), %rdi
	call	puts@PLT
	jmp	.L81
.L111:
	movslq	%eax, %r10
	movl	0(%rbp,%r10,4), %edx
	cmpl	%edx, %eax
	je	.L94
	movslq	%edx, %r11
	movl	0(%rbp,%r11,4), %eax
	cmpl	%eax, %edx
	jne	.L113
.L95:
	movl	%eax, 0(%rbp,%r10,4)
	movl	%eax, %edx
.L94:
	movl	%edx, 0(%rbp,%r8,4)
	jmp	.L93
.L110:
	movslq	%edx, %r10
	movl	0(%rbp,%r10,4), %eax
	cmpl	%eax, %edx
	je	.L85
	movslq	%eax, %r11
	movl	0(%rbp,%r11,4), %edi
	cmpl	%edi, %eax
	jne	.L114
.L86:
	movl	%edi, 0(%rbp,%r10,4)
	movl	%edi, %eax
.L85:
	movl	%eax, 0(%rbp,%r9,4)
	jmp	.L84
.L114:
	movslq	%edi, %rdx
	movl	0(%rbp,%rdx,4), %eax
	cmpl	%eax, %edi
	je	.L87
	movslq	%eax, %rdi
	movq	%rdi, (%rsp)
	movl	0(%rbp,%rdi,4), %edi
	cmpl	%edi, %eax
	jne	.L115
.L88:
	movl	%edi, 0(%rbp,%rdx,4)
	movl	%edi, %eax
.L87:
	movl	%eax, 0(%rbp,%r11,4)
	movl	%eax, %edi
	jmp	.L86
.L113:
	movslq	%eax, %rdx
	movl	0(%rbp,%rdx,4), %edi
	cmpl	%edi, %eax
	je	.L96
	movslq	%edi, %rax
	movq	%rax, (%rsp)
	movl	0(%rbp,%rax,4), %eax
	cmpl	%eax, %edi
	jne	.L116
.L97:
	movl	%eax, 0(%rbp,%rdx,4)
	movl	%eax, %edi
.L96:
	movl	%edi, 0(%rbp,%r11,4)
	movl	%edi, %eax
	jmp	.L95
.L103:
	xorl	%eax, %eax
	leaq	par(%rip), %rsi
	jmp	.L76
.L116:
	movslq	%eax, %rdi
	movq	%rdi, 8(%rsp)
	movl	0(%rbp,%rdi,4), %edi
	cmpl	%edi, %eax
	je	.L98
	movslq	%edi, %rax
	movq	%rax, 16(%rsp)
	movl	0(%rbp,%rax,4), %eax
	cmpl	%eax, %edi
	je	.L99
	movl	%eax, %edi
	xorl	%eax, %eax
	movq	%rdx, 24(%rsp)
	call	find
	movq	16(%rsp), %rdi
	movq	24(%rsp), %rdx
	movl	%eax, 0(%rbp,%rdi,4)
.L99:
	movq	8(%rsp), %rdi
	movl	%eax, 0(%rbp,%rdi,4)
	movl	%eax, %edi
.L98:
	movq	(%rsp), %rax
	movl	%edi, 0(%rbp,%rax,4)
	movl	%edi, %eax
	jmp	.L97
.L115:
	movslq	%edi, %rax
	movq	%rax, 8(%rsp)
	movl	0(%rbp,%rax,4), %eax
	cmpl	%eax, %edi
	je	.L89
	movslq	%eax, %rdi
	movq	%rdi, 16(%rsp)
	movl	0(%rbp,%rdi,4), %edi
	cmpl	%edi, %eax
	je	.L90
	xorl	%eax, %eax
	movq	%rdx, 24(%rsp)
	call	find
	movq	24(%rsp), %rdx
	movl	%eax, %edi
	movq	16(%rsp), %rax
	movl	%edi, 0(%rbp,%rax,4)
.L90:
	movq	8(%rsp), %rax
	movl	%edi, 0(%rbp,%rax,4)
	movl	%edi, %eax
.L89:
	movq	(%rsp), %rdi
	movl	%eax, 0(%rbp,%rdi,4)
	movl	%eax, %edi
	jmp	.L88
.L112:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE27:
	.size	main, .-main
	.globl	rank
	.bss
	.align 32
	.type	rank, @object
	.size	rank, 40004
rank:
	.zero	40004
	.globl	par
	.align 32
	.type	par, @object
	.size	par, 40004
par:
	.zero	40004
	.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
	.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 MAX 10001

 int par[MAX],rank[MAX];

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

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

 int unite(int x,int y){
               x=find(x);
               y=find(y);

               if(x==y)return;

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


 int same(int x,int y){return find(x)==find(y);}

 int main(){
        int n,q,com,i,x,y;
        scanf("%d%d",&n,&q);
        init(n);
        for(i=0;i<q;i++){
                    scanf("%d%d%d",&com,&x,&y);

                    if(com==0){unite(x,y);}
                    else 
                          {if(same(x,y)){printf("1\n");}
                           else {printf("0\n");}
                          }
                    }
        return 0;
        }


5 12
0 2 4
0 2 3
1 1 2
1 3 4
1 1 4
1 3 2
0 1 3
1 2 4
1 3 0
0 0 4
1 0 2
1 3 0
 5 12
0 1 4
0 2 3
1 1 2
1 3 4
1 1 4
1 2 2
0 1 3
1 2 4
1 3 0
0 0 4
1 0 2
1 3 0
 5 12
0 1 4
0 2 3
1 1 2
1 3 4
1 2 4
1 2 2
0 1 3
1 2 4
1 3 0
0 0 4
1 0 2
1 3 0
 5 12
0 1 4
0 2 3
1 1 2
1 3 4
1 2 4
1 2 2
1 1 3
1 2 4
1 3 0
0 0 4
1 0 2
1 3 0
 5 12
0 1 4
0 2 3
1 1 2
1 3 4
1 2 4
1 2 2
0 1 3
1 2 4
1 3 1
0 0 4
1 0 2
1 3 0
 5 12
0 2 4
0 2 3
1 1 3
1 3 4
1 2 4
1 2 2
1 1 3
1 2 4
1 3 0
0 0 4
1 0 2
1 3 0
 5 12
0 1 4
0 2 3
1 1 2
1 3 4
1 1 4
1 3 2
0 1 3
1 2 4
1 3 0
1 0 4
1 0 2
1 3 0
 5 12
0 1 4
0 2 3
1 1 1
1 3 4
1 2 4
1 2 2
0 1 3
1 2 4
1 3 0
0 0 4
1 0 2
1 3 0
 5 12
0 1 2
0 2 3
1 1 2
1 3 4
1 2 4
1 2 2
0 1 3
1 2 4
1 3 1
0 0 4
1 0 2
1 3 0
 5 12
0 2 4
0 2 3
1 1 3
1 3 4
1 2 4
1 2 2
1 1 3
1 2 4
1 3 0
0 1 4
1 0 2
1 3 0

0
1
0
1
1
0
1
1
 0
0
1
1
1
0
1
1
 0
0
0
1
1
0
1
1
 0
0
0
1
0
0
0
0
0
 0
0
0
1
1
1
1
1
 0
1
1
1
0
1
0
1
1
 0
0
1
1
1
0
0
0
0
 1
0
0
1
1
0
1
1
 1
0
0
1
0
1
0
0
 0
1
1
1
0
1
0
0
0

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 MAX 10001

 int par[MAX],rank[MAX];

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

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

 int unite(int x,int y){
               x=find(x);
               y=find(y);

               if(x==y)return;

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


 int same(int x,int y){return find(x)==find(y);}

 int main(){
        int n,q,com,i,x,y;
        scanf("%d%d",&n,&q);
        init(n);
        for(i=0;i<q;i++){
                    scanf("%d%d%d",&com,&x,&y);

                    if(com==0){unite(x,y);}
                    else 
                          {if(same(x,y)){printf("1\n");}
                           else {printf("0\n");}
                          }
                    }
        return 0;
        }

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	par
	.bss
	.align 32
	.type	par, @object
	.size	par, 40004
par:
	.zero	40004
	.globl	rank
	.align 32
	.type	rank, @object
	.size	rank, 40004
rank:
	.zero	40004
	.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,4), %rdx
	leaq	rank(%rip), %rax
	movl	$0, (%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	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	$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
	movl	$0, %eax
	call	find
	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	find, .-find
	.globl	unite
	.type	unite, @function
unite:
.LFB2:
	.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
	movl	$0, %eax
	call	find
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, %edi
	movl	$0, %eax
	call	find
	movl	%eax, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	je	.L11
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	rank(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	rank(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L10
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	par(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L9
.L10:
	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,4), %rdx
	leaq	rank(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	rank(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jne	.L9
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	rank(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	rank(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L9
.L11:
	nop
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	unite, .-unite
	.globl	same
	.type	same, @function
same:
.LFB3:
	.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
	movl	$0, %eax
	call	find
	movl	%eax, %ebx
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	movl	$0, %eax
	call	find
	cmpl	%eax, %ebx
	sete	%al
	movzbl	%al, %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	same, .-same
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d%d%d"
.LC2:
	.string	"1"
.LC3:
	.string	"0"
	.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
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	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
	movl	%eax, %edi
	call	init
	movl	$0, -12(%rbp)
	jmp	.L15
.L19:
	leaq	-16(%rbp), %rcx
	leaq	-20(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	testl	%eax, %eax
	jne	.L16
	movl	-16(%rbp), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	unite
	jmp	.L17
.L16:
	movl	-16(%rbp), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	same
	testl	%eax, %eax
	je	.L18
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L17
.L18:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L17:
	addl	$1, -12(%rbp)
.L15:
	movl	-28(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L19
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leave
	.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, 40004
par:
	.zero	40004
	.globl	rank
	.align 32
	.type	rank, @object
	.size	rank, 40004
rank:
	.zero	40004
	.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,4), %rdx
	leaq	rank(%rip), %rax
	movl	$0, (%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	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	$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
	movl	$0, %eax
	call	find
	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	find, .-find
	.globl	unite
	.type	unite, @function
unite:
.LFB2:
	.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
	movl	$0, %eax
	call	find
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, %edi
	movl	$0, %eax
	call	find
	movl	%eax, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	je	.L11
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	rank(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	rank(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L10
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	par(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L9
.L10:
	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,4), %rdx
	leaq	rank(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	rank(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jne	.L9
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	rank(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	rank(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L9
.L11:
	nop
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	unite, .-unite
	.globl	same
	.type	same, @function
same:
.LFB3:
	.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
	movl	$0, %eax
	call	find
	movl	%eax, %ebx
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	movl	$0, %eax
	call	find
	cmpl	%eax, %ebx
	sete	%al
	movzbl	%al, %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	same, .-same
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d%d%d"
.LC2:
	.string	"1"
.LC3:
	.string	"0"
	.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
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	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
	movl	%eax, %edi
	call	init
	movl	$0, -12(%rbp)
	jmp	.L15
.L19:
	leaq	-16(%rbp), %rcx
	leaq	-20(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	testl	%eax, %eax
	jne	.L16
	movl	-16(%rbp), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	unite
	jmp	.L17
.L16:
	movl	-16(%rbp), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	same
	testl	%eax, %eax
	je	.L18
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L17
.L18:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L17:
	addl	$1, -12(%rbp)
.L15:
	movl	-28(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L19
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leave
	.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:
