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>
#include <stdlib.h>

/* not complete */

int uf_table[100];

void uf_init(void) {
	int i;
	for(i=0;i<100;i++)uf_table[i]=0;
}

void uf_merge(int a,int b) {
	int next;
	while(uf_table[a]>0) {
		next=uf_table[a]-1;
		if(uf_table[next]>0)uf_table[a]=uf_table[next];
		a=next;
	}
	while(uf_table[b]>0) {
		next=uf_table[b]-1;
		if(uf_table[next]>0)uf_table[b]=uf_table[next];
		b=next;
	}
	if(a!=b)uf_table[a]=b+1;
}

int uf_issame(int a,int b) {
	int next;
	while(uf_table[a]>0) {
		next=uf_table[a]-1;
		if(uf_table[next]>0)uf_table[a]=uf_table[next];
		a=next;
	}
	while(uf_table[b]>0) {
		next=uf_table[b]-1;
		if(uf_table[next]>0)uf_table[b]=uf_table[next];
		b=next;
	}
	return a==b;
}

typedef struct {
	int a,b;
	int length;
} pipe_t;

pipe_t pipe[50*50*2];

int qsort_comp(const void* x,const void* y) {
	const pipe_t* a=(const pipe_t*)x;
	const pipe_t* b=(const pipe_t*)y;
	if((a->length)>(b->length))return 1;
	if((a->length)<(b->length))return -1;
	if((a->a)>(b->a))return 1;
	if((a->a)<(b->a))return -1;
	if((a->b)>(b->b))return 1;
	if((a->b)<(b->b))return -1;
	return 0;
}

int main(void) {
	int hs_num,ds_num;
	int now;
	int i,j;
	int pos;
	int result;
	while(1) {
		scanf("%d%d",&hs_num,&ds_num);
		if(hs_num==0 && ds_num==0)break;
		pos=0;
		for(i=0;i<hs_num;i++) {
			for(j=0;j<ds_num;j++) {
				scanf("%d",&now);
				if(now>0) {
					pipe[pos].a=i;
					pipe[pos].b=hs_num+j;
					pipe[pos].length=now;
					pos++;
				}
			}
		}
		for(i=0;i<ds_num;i++) {
			for(j=i+1;j<ds_num;j++) {
				scanf("%d",&now);
				if(now>0) {
					pipe[pos].a=hs_num+i;
					pipe[pos].b=hs_num+j;
					pipe[pos].length=now;
					pos++;
				}
			}
		}
		qsort(pipe,pos,sizeof(pipe_t),qsort_comp);
		uf_init();
		for(i=1;i<hs_num;i++)uf_merge(i-1,i);
		result=0;
		for(i=0,now=0;i<pos && now<ds_num;i++) {
			if(!uf_issame(pipe[i].a,pipe[i].b)) {
				uf_merge(pipe[i].a,pipe[i].b);
				result+=pipe[i].length;
				now++;
			}
		}
		printf("%d\n",result);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	uf_table
	.bss
	.align 32
	.type	uf_table, @object
	.size	uf_table, 400
uf_table:
	.zero	400
	.text
	.globl	uf_init
	.type	uf_init, @function
uf_init:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -4(%rbp)
	jmp	.L2
.L3:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -4(%rbp)
.L2:
	cmpl	$99, -4(%rbp)
	jle	.L3
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	uf_init, .-uf_init
	.globl	uf_merge
	.type	uf_merge, @function
uf_merge:
.LFB7:
	.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	%esi, -24(%rbp)
	jmp	.L5
.L7:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	$1, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jle	.L6
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	uf_table(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L6:
	movl	-4(%rbp), %eax
	movl	%eax, -20(%rbp)
.L5:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jg	.L7
	jmp	.L8
.L10:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	$1, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jle	.L9
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	uf_table(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L9:
	movl	-4(%rbp), %eax
	movl	%eax, -24(%rbp)
.L8:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jg	.L10
	movl	-20(%rbp), %eax
	cmpl	-24(%rbp), %eax
	je	.L12
	movl	-24(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L12:
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	uf_merge, .-uf_merge
	.globl	uf_issame
	.type	uf_issame, @function
uf_issame:
.LFB8:
	.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	%esi, -24(%rbp)
	jmp	.L14
.L16:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	$1, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jle	.L15
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	uf_table(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L15:
	movl	-4(%rbp), %eax
	movl	%eax, -20(%rbp)
.L14:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jg	.L16
	jmp	.L17
.L19:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	$1, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jle	.L18
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	uf_table(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L18:
	movl	-4(%rbp), %eax
	movl	%eax, -24(%rbp)
.L17:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jg	.L19
	movl	-20(%rbp), %eax
	cmpl	-24(%rbp), %eax
	sete	%al
	movzbl	%al, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	uf_issame, .-uf_issame
	.globl	pipe
	.bss
	.align 32
	.type	pipe, @object
	.size	pipe, 60000
pipe:
	.zero	60000
	.text
	.globl	qsort_comp
	.type	qsort_comp, @function
qsort_comp:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	movl	8(%rax), %edx
	movq	-8(%rbp), %rax
	movl	8(%rax), %eax
	cmpl	%eax, %edx
	jle	.L22
	movl	$1, %eax
	jmp	.L23
.L22:
	movq	-16(%rbp), %rax
	movl	8(%rax), %edx
	movq	-8(%rbp), %rax
	movl	8(%rax), %eax
	cmpl	%eax, %edx
	jge	.L24
	movl	$-1, %eax
	jmp	.L23
.L24:
	movq	-16(%rbp), %rax
	movl	(%rax), %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jle	.L25
	movl	$1, %eax
	jmp	.L23
.L25:
	movq	-16(%rbp), %rax
	movl	(%rax), %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jge	.L26
	movl	$-1, %eax
	jmp	.L23
.L26:
	movq	-16(%rbp), %rax
	movl	4(%rax), %edx
	movq	-8(%rbp), %rax
	movl	4(%rax), %eax
	cmpl	%eax, %edx
	jle	.L27
	movl	$1, %eax
	jmp	.L23
.L27:
	movq	-16(%rbp), %rax
	movl	4(%rax), %edx
	movq	-8(%rbp), %rax
	movl	4(%rax), %eax
	cmpl	%eax, %edx
	jge	.L28
	movl	$-1, %eax
	jmp	.L23
.L28:
	movl	$0, %eax
.L23:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	qsort_comp, .-qsort_comp
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L48:
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	testl	%eax, %eax
	jne	.L30
	movl	-32(%rbp), %eax
	testl	%eax, %eax
	je	.L52
.L30:
	movl	$0, -16(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L32
.L36:
	movl	$0, -20(%rbp)
	jmp	.L33
.L35:
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	testl	%eax, %eax
	jle	.L34
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	pipe(%rip), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-36(%rbp), %edx
	movl	-20(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+pipe(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-28(%rbp), %edx
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	8+pipe(%rip), %rax
	movl	%edx, (%rcx,%rax)
	addl	$1, -16(%rbp)
.L34:
	addl	$1, -20(%rbp)
.L33:
	movl	-32(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L35
	addl	$1, -24(%rbp)
.L32:
	movl	-36(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L36
	movl	$0, -24(%rbp)
	jmp	.L37
.L41:
	movl	-24(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -20(%rbp)
	jmp	.L38
.L40:
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	testl	%eax, %eax
	jle	.L39
	movl	-36(%rbp), %edx
	movl	-24(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	pipe(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-36(%rbp), %edx
	movl	-20(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+pipe(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-28(%rbp), %edx
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	8+pipe(%rip), %rax
	movl	%edx, (%rcx,%rax)
	addl	$1, -16(%rbp)
.L39:
	addl	$1, -20(%rbp)
.L38:
	movl	-32(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L40
	addl	$1, -24(%rbp)
.L37:
	movl	-32(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L41
	movl	-16(%rbp), %eax
	cltq
	leaq	qsort_comp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$12, %edx
	movq	%rax, %rsi
	leaq	pipe(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	call	uf_init
	movl	$1, -24(%rbp)
	jmp	.L42
.L43:
	movl	-24(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	uf_merge
	addl	$1, -24(%rbp)
.L42:
	movl	-36(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L43
	movl	$0, -12(%rbp)
	movl	$0, -24(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L44
.L47:
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+pipe(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	pipe(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	uf_issame
	testl	%eax, %eax
	jne	.L45
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+pipe(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	pipe(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	uf_merge
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+pipe(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -12(%rbp)
	movl	-28(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -28(%rbp)
.L45:
	addl	$1, -24(%rbp)
.L44:
	movl	-24(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jge	.L46
	movl	-28(%rbp), %edx
	movl	-32(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L47
.L46:
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L48
.L52:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L50
	call	__stack_chk_fail@PLT
.L50:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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	qsort_comp
	.type	qsort_comp, @function
qsort_comp:
.LFB42:
	.cfi_startproc
	endbr64
	movl	8(%rsi), %edx
	movl	$1, %eax
	cmpl	%edx, 8(%rdi)
	jg	.L1
	movl	$-1, %eax
	jl	.L1
	movl	(%rsi), %ecx
	movl	$1, %eax
	cmpl	%ecx, (%rdi)
	jg	.L1
	movl	$-1, %eax
	jl	.L1
	movl	4(%rsi), %ecx
	movl	$1, %eax
	cmpl	%ecx, 4(%rdi)
	jg	.L1
	setl	%al
	movzbl	%al, %eax
	negl	%eax
.L1:
	ret
	.cfi_endproc
.LFE42:
	.size	qsort_comp, .-qsort_comp
	.p2align 4
	.globl	uf_init
	.type	uf_init, @function
uf_init:
.LFB39:
	.cfi_startproc
	endbr64
	leaq	uf_table(%rip), %rdx
	movl	$50, %ecx
	xorl	%eax, %eax
	movq	%rdx, %rdi
	rep stosq
	ret
	.cfi_endproc
.LFE39:
	.size	uf_init, .-uf_init
	.p2align 4
	.globl	uf_merge
	.type	uf_merge, @function
uf_merge:
.LFB40:
	.cfi_startproc
	endbr64
	leaq	uf_table(%rip), %rax
	movslq	%edi, %rcx
	movl	(%rax,%rcx,4), %r8d
	testl	%r8d, %r8d
	jle	.L18
	subl	$1, %r8d
	movslq	%r8d, %rdx
	movl	(%rax,%rdx,4), %edx
	testl	%edx, %edx
	jle	.L24
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%edx, (%rax,%rcx,4)
	leal	-1(%rdx), %ecx
	movl	%r8d, %edi
	movslq	%ecx, %rdx
	movl	(%rax,%rdx,4), %edx
	testl	%edx, %edx
	jle	.L11
	movl	%ecx, %r8d
	movslq	%edi, %rcx
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L24:
	movl	%r8d, %ecx
	.p2align 4,,10
	.p2align 3
.L11:
	movslq	%esi, %rdi
	movl	(%rax,%rdi,4), %r8d
	testl	%r8d, %r8d
	jle	.L20
.L26:
	subl	$1, %r8d
	movslq	%r8d, %rdx
	movl	(%rax,%rdx,4), %edx
	testl	%edx, %edx
	jle	.L25
	.p2align 4,,10
	.p2align 3
.L15:
	movl	%edx, (%rax,%rdi,4)
	leal	-1(%rdx), %edi
	movl	%r8d, %esi
	movslq	%edi, %rdx
	movl	(%rax,%rdx,4), %edx
	testl	%edx, %edx
	jle	.L14
	movl	%edi, %r8d
	movslq	%esi, %rdi
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L25:
	movl	%r8d, %edi
	.p2align 4,,10
	.p2align 3
.L14:
	cmpl	%edi, %ecx
	je	.L10
	movslq	%ecx, %rcx
	addl	$1, %edi
	movl	%edi, (%rax,%rcx,4)
.L10:
	ret
	.p2align 4,,10
	.p2align 3
.L18:
	movl	%edi, %ecx
	movslq	%esi, %rdi
	movl	(%rax,%rdi,4), %r8d
	testl	%r8d, %r8d
	jg	.L26
	.p2align 4,,10
	.p2align 3
.L20:
	movl	%esi, %edi
	jmp	.L14
	.cfi_endproc
.LFE40:
	.size	uf_merge, .-uf_merge
	.p2align 4
	.globl	uf_issame
	.type	uf_issame, @function
uf_issame:
.LFB41:
	.cfi_startproc
	endbr64
	leaq	uf_table(%rip), %rax
	movslq	%edi, %r8
	movl	(%rax,%r8,4), %ecx
	testl	%ecx, %ecx
	jle	.L34
	subl	$1, %ecx
	movslq	%ecx, %rdx
	movl	(%rax,%rdx,4), %edx
	testl	%edx, %edx
	jle	.L40
	.p2align 4,,10
	.p2align 3
.L29:
	movl	%edx, (%rax,%r8,4)
	leal	-1(%rdx), %r8d
	movl	%ecx, %edi
	movslq	%r8d, %rdx
	movl	(%rax,%rdx,4), %edx
	testl	%edx, %edx
	jle	.L28
	movl	%r8d, %ecx
	movslq	%edi, %r8
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L40:
	movl	%ecx, %r8d
	.p2align 4,,10
	.p2align 3
.L28:
	movslq	%esi, %rcx
	movl	(%rax,%rcx,4), %edi
	testl	%edi, %edi
	jle	.L36
.L42:
	subl	$1, %edi
	movslq	%edi, %rdx
	movl	(%rax,%rdx,4), %edx
	testl	%edx, %edx
	jle	.L41
	.p2align 4,,10
	.p2align 3
.L32:
	movl	%edx, (%rax,%rcx,4)
	leal	-1(%rdx), %ecx
	movl	%edi, %esi
	movslq	%ecx, %rdx
	movl	(%rax,%rdx,4), %edx
	testl	%edx, %edx
	jle	.L31
	movl	%ecx, %edi
	movslq	%esi, %rcx
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L41:
	movl	%edi, %ecx
.L31:
	xorl	%eax, %eax
	cmpl	%ecx, %r8d
	sete	%al
	ret
	.p2align 4,,10
	.p2align 3
.L34:
	movslq	%esi, %rcx
	movl	%edi, %r8d
	movl	(%rax,%rcx,4), %edi
	testl	%edi, %edi
	jg	.L42
.L36:
	movl	%esi, %ecx
	xorl	%eax, %eax
	cmpl	%ecx, %r8d
	sete	%al
	ret
	.cfi_endproc
.LFE41:
	.size	uf_issame, .-uf_issame
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB43:
	.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
	leaq	.LC1(%rip), %r14
	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	48(%rsp), %rax
	movq	%rax, 24(%rsp)
	leaq	44(%rsp), %rax
	movq	%rax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L87:
	movq	24(%rsp), %rdx
	movq	16(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %r12d
	movl	48(%rsp), %eax
	testl	%r12d, %r12d
	jne	.L127
	testl	%eax, %eax
	je	.L128
.L46:
	testl	%eax, %eax
	jle	.L52
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L57:
	movl	%r13d, %ebp
	addl	$1, %r13d
	cmpl	%eax, %r13d
	jge	.L52
	movl	%r13d, %ebx
	leaq	52(%rsp), %r15
	.p2align 4,,10
	.p2align 3
.L56:
	movd	%ebx, %xmm2
	movd	%ebp, %xmm1
	movq	%r15, %rsi
	movq	%r14, %rdi
	punpckldq	%xmm2, %xmm1
	xorl	%eax, %eax
	movq	%xmm1, (%rsp)
	call	__isoc99_scanf@PLT
	movl	52(%rsp), %eax
	testl	%eax, %eax
	jle	.L53
	movd	44(%rsp), %xmm4
	movq	(%rsp), %xmm1
	movslq	%r12d, %rcx
	addl	$1, %ebx
	leaq	(%rcx,%rcx,2), %rcx
	leaq	pipe(%rip), %rdi
	addl	$1, %r12d
	pshufd	$0xe0, %xmm4, %xmm0
	movl	%eax, 8(%rdi,%rcx,4)
	paddd	%xmm1, %xmm0
	movq	%xmm0, (%rdi,%rcx,4)
	movl	48(%rsp), %eax
	cmpl	%ebx, %eax
	jg	.L56
	cmpl	%eax, %r13d
	jl	.L57
	.p2align 4,,10
	.p2align 3
.L52:
	leaq	qsort_comp(%rip), %rcx
	movl	$12, %edx
	leaq	pipe(%rip), %rdi
	movslq	%r12d, %rsi
	call	qsort@PLT
	xorl	%eax, %eax
	movl	$50, %ecx
	xorl	%r8d, %r8d
	leaq	uf_table(%rip), %rdx
	movq	%rdx, %rdi
	leaq	4(%rdx), %r9
	rep stosq
	movl	44(%rsp), %eax
	leal	-1(%rax), %r10d
	cmpl	$1, %eax
	jle	.L69
	.p2align 4,,10
	.p2align 3
.L68:
	movl	(%rdx,%r8,4), %r11d
	leal	1(%r8), %ecx
	movslq	%r8d, %rsi
	testl	%r11d, %r11d
	jle	.L91
	subl	$1, %r11d
	movslq	%r11d, %rax
	movl	%r11d, %edi
	movl	(%rdx,%rax,4), %eax
	testl	%eax, %eax
	jle	.L61
	.p2align 4,,10
	.p2align 3
.L62:
	leal	-1(%rax), %edi
	movl	%eax, (%rdx,%rsi,4)
	movslq	%r11d, %rsi
	movslq	%edi, %rax
	movl	(%rdx,%rax,4), %eax
	testl	%eax, %eax
	jle	.L61
	movl	%edi, %r11d
	jmp	.L62
	.p2align 4,,10
	.p2align 3
.L53:
	movl	48(%rsp), %eax
	addl	$1, %ebx
	cmpl	%ebx, %eax
	jg	.L56
	cmpl	%eax, %r13d
	jl	.L57
	jmp	.L52
	.p2align 4,,10
	.p2align 3
.L91:
	movl	%r8d, %edi
	.p2align 4,,10
	.p2align 3
.L61:
	movl	(%r9,%r8,4), %r11d
	testl	%r11d, %r11d
	jle	.L93
	subl	$1, %r11d
	movslq	%r11d, %rax
	movl	%r11d, %esi
	movl	(%rdx,%rax,4), %eax
	testl	%eax, %eax
	jle	.L64
	.p2align 4,,10
	.p2align 3
.L65:
	movslq	%ecx, %rcx
	leal	-1(%rax), %esi
	movl	%eax, (%rdx,%rcx,4)
	movslq	%esi, %rax
	movl	%r11d, %ecx
	movl	(%rdx,%rax,4), %eax
	testl	%eax, %eax
	jle	.L64
	movl	%esi, %r11d
	jmp	.L65
.L93:
	movl	%ecx, %esi
	.p2align 4,,10
	.p2align 3
.L64:
	cmpl	%esi, %edi
	je	.L67
	movslq	%edi, %rdi
	addl	$1, %esi
	movl	%esi, (%rdx,%rdi,4)
.L67:
	addq	$1, %r8
	cmpq	%r10, %r8
	jne	.L68
.L69:
	movl	$0, 52(%rsp)
	testl	%r12d, %r12d
	je	.L60
	leal	-1(%r12), %eax
	movb	$0, 15(%rsp)
	xorl	%r13d, %r13d
	xorl	%r12d, %r12d
	leaq	pipe(%rip), %rbp
	leaq	(%rax,%rax,2), %rcx
	movl	48(%rsp), %r15d
	leaq	12(%rbp), %rax
	leaq	(%rax,%rcx,4), %rax
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L70:
	cmpl	%r13d, %r15d
	jle	.L126
	movslq	0(%rbp), %rbx
	movl	4(%rbp), %r10d
	movl	(%rdx,%rbx,4), %eax
	movq	%rbx, %r9
	testl	%eax, %eax
	jle	.L95
	movslq	%ebx, %rcx
	jmp	.L72
	.p2align 4,,10
	.p2align 3
.L129:
	movl	%eax, (%rdx,%rcx,4)
	movslq	%esi, %rcx
.L72:
	leal	-1(%rax), %esi
	movslq	%esi, %rax
	movl	(%rdx,%rax,4), %eax
	testl	%eax, %eax
	jg	.L129
.L71:
	movslq	%r10d, %r11
	movl	(%rdx,%r11,4), %r8d
	testl	%r8d, %r8d
	jle	.L96
	subl	$1, %r8d
	movslq	%r10d, %rcx
	movslq	%r8d, %rax
	movl	%r8d, %edi
	movl	(%rdx,%rax,4), %eax
	testl	%eax, %eax
	jle	.L73
	.p2align 4,,10
	.p2align 3
.L74:
	leal	-1(%rax), %edi
	movl	%eax, (%rdx,%rcx,4)
	movslq	%r8d, %rcx
	movslq	%edi, %rax
	movl	(%rdx,%rax,4), %eax
	testl	%eax, %eax
	jle	.L73
	movl	%edi, %r8d
	jmp	.L74
.L96:
	movl	%r10d, %edi
	.p2align 4,,10
	.p2align 3
.L73:
	cmpl	%edi, %esi
	jne	.L130
.L76:
	addq	$12, %rbp
	cmpq	(%rsp), %rbp
	jne	.L70
.L126:
	cmpb	$0, 15(%rsp)
	je	.L60
	movl	%r13d, 52(%rsp)
.L60:
	movl	%r12d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L87
	.p2align 4,,10
	.p2align 3
.L130:
	movl	(%rdx,%rbx,4), %ecx
	testl	%ecx, %ecx
	jle	.L77
	subl	$1, %ecx
	movslq	%ecx, %rax
	movl	%ecx, %r9d
	movl	(%rdx,%rax,4), %eax
	testl	%eax, %eax
	jle	.L77
	.p2align 4,,10
	.p2align 3
.L78:
	leal	-1(%rax), %r9d
	movl	%eax, (%rdx,%rbx,4)
	movslq	%ecx, %rbx
	movslq	%r9d, %rax
	movl	(%rdx,%rax,4), %eax
	testl	%eax, %eax
	jle	.L77
	movl	%r9d, %ecx
	jmp	.L78
	.p2align 4,,10
	.p2align 3
.L77:
	movl	(%rdx,%r11,4), %ecx
	testl	%ecx, %ecx
	jle	.L80
	subl	$1, %ecx
	movslq	%ecx, %rax
	movl	%ecx, %r10d
	movl	(%rdx,%rax,4), %eax
	testl	%eax, %eax
	jle	.L80
	.p2align 4,,10
	.p2align 3
.L81:
	leal	-1(%rax), %r10d
	movl	%eax, (%rdx,%r11,4)
	movslq	%ecx, %r11
	movslq	%r10d, %rax
	movl	(%rdx,%rax,4), %eax
	testl	%eax, %eax
	jle	.L80
	movl	%r10d, %ecx
	jmp	.L81
	.p2align 4,,10
	.p2align 3
.L80:
	cmpl	%r10d, %r9d
	je	.L83
	movslq	%r9d, %r9
	addl	$1, %r10d
	movl	%r10d, (%rdx,%r9,4)
.L83:
	movb	$1, 15(%rsp)
	addl	8(%rbp), %r12d
	addl	$1, %r13d
	jmp	.L76
.L95:
	movl	%ebx, %esi
	jmp	.L71
.L127:
	movl	$0, %r12d
	jle	.L46
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L45:
	testl	%eax, %eax
	jle	.L52
	xorl	%ebx, %ebx
	leaq	52(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L51:
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	52(%rsp), %eax
	testl	%eax, %eax
	jle	.L48
	movl	44(%rsp), %edx
	movd	%ebp, %xmm0
	leaq	pipe(%rip), %rdi
	addl	%ebx, %edx
	addl	$1, %ebx
	movd	%edx, %xmm3
	movslq	%r12d, %rdx
	addl	$1, %r12d
	leaq	(%rdx,%rdx,2), %rdx
	punpckldq	%xmm3, %xmm0
	movl	%eax, 8(%rdi,%rdx,4)
	movq	%xmm0, (%rdi,%rdx,4)
	movl	48(%rsp), %eax
	cmpl	%eax, %ebx
	jl	.L51
	addl	$1, %ebp
	cmpl	44(%rsp), %ebp
	jl	.L45
	jmp	.L46
	.p2align 4,,10
	.p2align 3
.L48:
	movl	48(%rsp), %eax
	addl	$1, %ebx
	cmpl	%ebx, %eax
	jg	.L51
	addl	$1, %ebp
	cmpl	44(%rsp), %ebp
	jl	.L45
	jmp	.L46
.L128:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L131
	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
.L131:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE43:
	.size	main, .-main
	.globl	pipe
	.bss
	.align 32
	.type	pipe, @object
	.size	pipe, 60000
pipe:
	.zero	60000
	.globl	uf_table
	.align 32
	.type	uf_table, @object
	.size	uf_table, 400
uf_table:
	.zero	400
	.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	qsort_comp
	.type	qsort_comp, @function
qsort_comp:
.LFB42:
	.cfi_startproc
	endbr64
	movl	8(%rsi), %edx
	movl	$1, %eax
	cmpl	%edx, 8(%rdi)
	jg	.L1
	movl	$-1, %eax
	jl	.L1
	movl	(%rsi), %ecx
	movl	$1, %eax
	cmpl	%ecx, (%rdi)
	jg	.L1
	movl	$-1, %eax
	jl	.L1
	movl	4(%rsi), %ecx
	movl	$1, %eax
	cmpl	%ecx, 4(%rdi)
	jg	.L1
	setl	%al
	movzbl	%al, %eax
	negl	%eax
.L1:
	ret
	.cfi_endproc
.LFE42:
	.size	qsort_comp, .-qsort_comp
	.p2align 4
	.globl	uf_init
	.type	uf_init, @function
uf_init:
.LFB39:
	.cfi_startproc
	endbr64
	leaq	uf_table(%rip), %rdx
	movl	$50, %ecx
	xorl	%eax, %eax
	movq	%rdx, %rdi
	rep stosq
	ret
	.cfi_endproc
.LFE39:
	.size	uf_init, .-uf_init
	.p2align 4
	.globl	uf_merge
	.type	uf_merge, @function
uf_merge:
.LFB40:
	.cfi_startproc
	endbr64
	leaq	uf_table(%rip), %rax
	movslq	%edi, %rcx
	movl	(%rax,%rcx,4), %r8d
	testl	%r8d, %r8d
	jle	.L18
	subl	$1, %r8d
	movslq	%r8d, %rdx
	movl	(%rax,%rdx,4), %edx
	testl	%edx, %edx
	jle	.L24
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%edx, (%rax,%rcx,4)
	leal	-1(%rdx), %ecx
	movl	%r8d, %edi
	movslq	%ecx, %rdx
	movl	(%rax,%rdx,4), %edx
	testl	%edx, %edx
	jle	.L11
	movl	%ecx, %r8d
	movslq	%edi, %rcx
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L24:
	movl	%r8d, %ecx
	.p2align 4,,10
	.p2align 3
.L11:
	movslq	%esi, %rdi
	movl	(%rax,%rdi,4), %r8d
	testl	%r8d, %r8d
	jle	.L20
.L26:
	subl	$1, %r8d
	movslq	%r8d, %rdx
	movl	(%rax,%rdx,4), %edx
	testl	%edx, %edx
	jle	.L25
	.p2align 4,,10
	.p2align 3
.L15:
	movl	%edx, (%rax,%rdi,4)
	leal	-1(%rdx), %edi
	movl	%r8d, %esi
	movslq	%edi, %rdx
	movl	(%rax,%rdx,4), %edx
	testl	%edx, %edx
	jle	.L14
	movl	%edi, %r8d
	movslq	%esi, %rdi
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L25:
	movl	%r8d, %edi
	.p2align 4,,10
	.p2align 3
.L14:
	cmpl	%edi, %ecx
	je	.L10
	movslq	%ecx, %rcx
	addl	$1, %edi
	movl	%edi, (%rax,%rcx,4)
.L10:
	ret
	.p2align 4,,10
	.p2align 3
.L18:
	movl	%edi, %ecx
	movslq	%esi, %rdi
	movl	(%rax,%rdi,4), %r8d
	testl	%r8d, %r8d
	jg	.L26
	.p2align 4,,10
	.p2align 3
.L20:
	movl	%esi, %edi
	jmp	.L14
	.cfi_endproc
.LFE40:
	.size	uf_merge, .-uf_merge
	.p2align 4
	.globl	uf_issame
	.type	uf_issame, @function
uf_issame:
.LFB41:
	.cfi_startproc
	endbr64
	leaq	uf_table(%rip), %rax
	movslq	%edi, %r8
	movl	(%rax,%r8,4), %ecx
	testl	%ecx, %ecx
	jle	.L34
	subl	$1, %ecx
	movslq	%ecx, %rdx
	movl	(%rax,%rdx,4), %edx
	testl	%edx, %edx
	jle	.L40
	.p2align 4,,10
	.p2align 3
.L29:
	movl	%edx, (%rax,%r8,4)
	leal	-1(%rdx), %r8d
	movl	%ecx, %edi
	movslq	%r8d, %rdx
	movl	(%rax,%rdx,4), %edx
	testl	%edx, %edx
	jle	.L28
	movl	%r8d, %ecx
	movslq	%edi, %r8
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L40:
	movl	%ecx, %r8d
	.p2align 4,,10
	.p2align 3
.L28:
	movslq	%esi, %rcx
	movl	(%rax,%rcx,4), %edi
	testl	%edi, %edi
	jle	.L36
.L42:
	subl	$1, %edi
	movslq	%edi, %rdx
	movl	(%rax,%rdx,4), %edx
	testl	%edx, %edx
	jle	.L41
	.p2align 4,,10
	.p2align 3
.L32:
	movl	%edx, (%rax,%rcx,4)
	leal	-1(%rdx), %ecx
	movl	%edi, %esi
	movslq	%ecx, %rdx
	movl	(%rax,%rdx,4), %edx
	testl	%edx, %edx
	jle	.L31
	movl	%ecx, %edi
	movslq	%esi, %rcx
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L41:
	movl	%edi, %ecx
.L31:
	xorl	%eax, %eax
	cmpl	%ecx, %r8d
	sete	%al
	ret
	.p2align 4,,10
	.p2align 3
.L34:
	movslq	%esi, %rcx
	movl	%edi, %r8d
	movl	(%rax,%rcx,4), %edi
	testl	%edi, %edi
	jg	.L42
.L36:
	movl	%esi, %ecx
	xorl	%eax, %eax
	cmpl	%ecx, %r8d
	sete	%al
	ret
	.cfi_endproc
.LFE41:
	.size	uf_issame, .-uf_issame
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB43:
	.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
	leaq	.LC1(%rip), %r14
	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	48(%rsp), %rax
	movq	%rax, 24(%rsp)
	leaq	44(%rsp), %rax
	movq	%rax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L87:
	movq	24(%rsp), %rdx
	movq	16(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %r12d
	movl	48(%rsp), %eax
	testl	%r12d, %r12d
	jne	.L127
	testl	%eax, %eax
	je	.L128
.L46:
	testl	%eax, %eax
	jle	.L52
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L57:
	movl	%r13d, %ebp
	addl	$1, %r13d
	cmpl	%eax, %r13d
	jge	.L52
	movl	%r13d, %ebx
	leaq	52(%rsp), %r15
	.p2align 4,,10
	.p2align 3
.L56:
	movd	%ebx, %xmm2
	movd	%ebp, %xmm1
	movq	%r15, %rsi
	movq	%r14, %rdi
	punpckldq	%xmm2, %xmm1
	xorl	%eax, %eax
	movq	%xmm1, (%rsp)
	call	__isoc99_scanf@PLT
	movl	52(%rsp), %eax
	testl	%eax, %eax
	jle	.L53
	movd	44(%rsp), %xmm4
	movq	(%rsp), %xmm1
	movslq	%r12d, %rcx
	addl	$1, %ebx
	leaq	(%rcx,%rcx,2), %rcx
	leaq	pipe(%rip), %rdi
	addl	$1, %r12d
	pshufd	$0xe0, %xmm4, %xmm0
	movl	%eax, 8(%rdi,%rcx,4)
	paddd	%xmm1, %xmm0
	movq	%xmm0, (%rdi,%rcx,4)
	movl	48(%rsp), %eax
	cmpl	%ebx, %eax
	jg	.L56
	cmpl	%eax, %r13d
	jl	.L57
	.p2align 4,,10
	.p2align 3
.L52:
	leaq	qsort_comp(%rip), %rcx
	movl	$12, %edx
	leaq	pipe(%rip), %rdi
	movslq	%r12d, %rsi
	call	qsort@PLT
	xorl	%eax, %eax
	movl	$50, %ecx
	xorl	%r8d, %r8d
	leaq	uf_table(%rip), %rdx
	movq	%rdx, %rdi
	leaq	4(%rdx), %r9
	rep stosq
	movl	44(%rsp), %eax
	leal	-1(%rax), %r10d
	cmpl	$1, %eax
	jle	.L69
	.p2align 4,,10
	.p2align 3
.L68:
	movl	(%rdx,%r8,4), %r11d
	leal	1(%r8), %ecx
	movslq	%r8d, %rsi
	testl	%r11d, %r11d
	jle	.L91
	subl	$1, %r11d
	movslq	%r11d, %rax
	movl	%r11d, %edi
	movl	(%rdx,%rax,4), %eax
	testl	%eax, %eax
	jle	.L61
	.p2align 4,,10
	.p2align 3
.L62:
	leal	-1(%rax), %edi
	movl	%eax, (%rdx,%rsi,4)
	movslq	%r11d, %rsi
	movslq	%edi, %rax
	movl	(%rdx,%rax,4), %eax
	testl	%eax, %eax
	jle	.L61
	movl	%edi, %r11d
	jmp	.L62
	.p2align 4,,10
	.p2align 3
.L53:
	movl	48(%rsp), %eax
	addl	$1, %ebx
	cmpl	%ebx, %eax
	jg	.L56
	cmpl	%eax, %r13d
	jl	.L57
	jmp	.L52
	.p2align 4,,10
	.p2align 3
.L91:
	movl	%r8d, %edi
	.p2align 4,,10
	.p2align 3
.L61:
	movl	(%r9,%r8,4), %r11d
	testl	%r11d, %r11d
	jle	.L93
	subl	$1, %r11d
	movslq	%r11d, %rax
	movl	%r11d, %esi
	movl	(%rdx,%rax,4), %eax
	testl	%eax, %eax
	jle	.L64
	.p2align 4,,10
	.p2align 3
.L65:
	movslq	%ecx, %rcx
	leal	-1(%rax), %esi
	movl	%eax, (%rdx,%rcx,4)
	movslq	%esi, %rax
	movl	%r11d, %ecx
	movl	(%rdx,%rax,4), %eax
	testl	%eax, %eax
	jle	.L64
	movl	%esi, %r11d
	jmp	.L65
.L93:
	movl	%ecx, %esi
	.p2align 4,,10
	.p2align 3
.L64:
	cmpl	%esi, %edi
	je	.L67
	movslq	%edi, %rdi
	addl	$1, %esi
	movl	%esi, (%rdx,%rdi,4)
.L67:
	addq	$1, %r8
	cmpq	%r10, %r8
	jne	.L68
.L69:
	movl	$0, 52(%rsp)
	testl	%r12d, %r12d
	je	.L60
	leal	-1(%r12), %eax
	movb	$0, 15(%rsp)
	xorl	%r13d, %r13d
	xorl	%r12d, %r12d
	leaq	pipe(%rip), %rbp
	leaq	(%rax,%rax,2), %rcx
	movl	48(%rsp), %r15d
	leaq	12(%rbp), %rax
	leaq	(%rax,%rcx,4), %rax
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L70:
	cmpl	%r13d, %r15d
	jle	.L126
	movslq	0(%rbp), %rbx
	movl	4(%rbp), %r10d
	movl	(%rdx,%rbx,4), %eax
	movq	%rbx, %r9
	testl	%eax, %eax
	jle	.L95
	movslq	%ebx, %rcx
	jmp	.L72
	.p2align 4,,10
	.p2align 3
.L129:
	movl	%eax, (%rdx,%rcx,4)
	movslq	%esi, %rcx
.L72:
	leal	-1(%rax), %esi
	movslq	%esi, %rax
	movl	(%rdx,%rax,4), %eax
	testl	%eax, %eax
	jg	.L129
.L71:
	movslq	%r10d, %r11
	movl	(%rdx,%r11,4), %r8d
	testl	%r8d, %r8d
	jle	.L96
	subl	$1, %r8d
	movslq	%r10d, %rcx
	movslq	%r8d, %rax
	movl	%r8d, %edi
	movl	(%rdx,%rax,4), %eax
	testl	%eax, %eax
	jle	.L73
	.p2align 4,,10
	.p2align 3
.L74:
	leal	-1(%rax), %edi
	movl	%eax, (%rdx,%rcx,4)
	movslq	%r8d, %rcx
	movslq	%edi, %rax
	movl	(%rdx,%rax,4), %eax
	testl	%eax, %eax
	jle	.L73
	movl	%edi, %r8d
	jmp	.L74
.L96:
	movl	%r10d, %edi
	.p2align 4,,10
	.p2align 3
.L73:
	cmpl	%edi, %esi
	jne	.L130
.L76:
	addq	$12, %rbp
	cmpq	(%rsp), %rbp
	jne	.L70
.L126:
	cmpb	$0, 15(%rsp)
	je	.L60
	movl	%r13d, 52(%rsp)
.L60:
	movl	%r12d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L87
	.p2align 4,,10
	.p2align 3
.L130:
	movl	(%rdx,%rbx,4), %ecx
	testl	%ecx, %ecx
	jle	.L77
	subl	$1, %ecx
	movslq	%ecx, %rax
	movl	%ecx, %r9d
	movl	(%rdx,%rax,4), %eax
	testl	%eax, %eax
	jle	.L77
	.p2align 4,,10
	.p2align 3
.L78:
	leal	-1(%rax), %r9d
	movl	%eax, (%rdx,%rbx,4)
	movslq	%ecx, %rbx
	movslq	%r9d, %rax
	movl	(%rdx,%rax,4), %eax
	testl	%eax, %eax
	jle	.L77
	movl	%r9d, %ecx
	jmp	.L78
	.p2align 4,,10
	.p2align 3
.L77:
	movl	(%rdx,%r11,4), %ecx
	testl	%ecx, %ecx
	jle	.L80
	subl	$1, %ecx
	movslq	%ecx, %rax
	movl	%ecx, %r10d
	movl	(%rdx,%rax,4), %eax
	testl	%eax, %eax
	jle	.L80
	.p2align 4,,10
	.p2align 3
.L81:
	leal	-1(%rax), %r10d
	movl	%eax, (%rdx,%r11,4)
	movslq	%ecx, %r11
	movslq	%r10d, %rax
	movl	(%rdx,%rax,4), %eax
	testl	%eax, %eax
	jle	.L80
	movl	%r10d, %ecx
	jmp	.L81
	.p2align 4,,10
	.p2align 3
.L80:
	cmpl	%r10d, %r9d
	je	.L83
	movslq	%r9d, %r9
	addl	$1, %r10d
	movl	%r10d, (%rdx,%r9,4)
.L83:
	movb	$1, 15(%rsp)
	addl	8(%rbp), %r12d
	addl	$1, %r13d
	jmp	.L76
.L95:
	movl	%ebx, %esi
	jmp	.L71
.L127:
	movl	$0, %r12d
	jle	.L46
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L45:
	testl	%eax, %eax
	jle	.L52
	xorl	%ebx, %ebx
	leaq	52(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L51:
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	52(%rsp), %eax
	testl	%eax, %eax
	jle	.L48
	movl	44(%rsp), %edx
	movd	%ebp, %xmm0
	leaq	pipe(%rip), %rdi
	addl	%ebx, %edx
	addl	$1, %ebx
	movd	%edx, %xmm3
	movslq	%r12d, %rdx
	addl	$1, %r12d
	leaq	(%rdx,%rdx,2), %rdx
	punpckldq	%xmm3, %xmm0
	movl	%eax, 8(%rdi,%rdx,4)
	movq	%xmm0, (%rdi,%rdx,4)
	movl	48(%rsp), %eax
	cmpl	%eax, %ebx
	jl	.L51
	addl	$1, %ebp
	cmpl	44(%rsp), %ebp
	jl	.L45
	jmp	.L46
	.p2align 4,,10
	.p2align 3
.L48:
	movl	48(%rsp), %eax
	addl	$1, %ebx
	cmpl	%ebx, %eax
	jg	.L51
	addl	$1, %ebp
	cmpl	44(%rsp), %ebp
	jl	.L45
	jmp	.L46
.L128:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L131
	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
.L131:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE43:
	.size	main, .-main
	.globl	pipe
	.bss
	.align 32
	.type	pipe, @object
	.size	pipe, 60000
pipe:
	.zero	60000
	.globl	uf_table
	.align 32
	.type	uf_table, @object
	.size	uf_table, 400
uf_table:
	.zero	400
	.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>
#include <stdlib.h>

/* not complete */

int uf_table[100];

void uf_init(void) {
	int i;
	for(i=0;i<100;i++)uf_table[i]=0;
}

void uf_merge(int a,int b) {
	int next;
	while(uf_table[a]>0) {
		next=uf_table[a]-1;
		if(uf_table[next]>0)uf_table[a]=uf_table[next];
		a=next;
	}
	while(uf_table[b]>0) {
		next=uf_table[b]-1;
		if(uf_table[next]>0)uf_table[b]=uf_table[next];
		b=next;
	}
	if(a!=b)uf_table[a]=b+1;
}

int uf_issame(int a,int b) {
	int next;
	while(uf_table[a]>0) {
		next=uf_table[a]-1;
		if(uf_table[next]>0)uf_table[a]=uf_table[next];
		a=next;
	}
	while(uf_table[b]>0) {
		next=uf_table[b]-1;
		if(uf_table[next]>0)uf_table[b]=uf_table[next];
		b=next;
	}
	return a==b;
}

typedef struct {
	int a,b;
	int length;
} pipe_t;

pipe_t pipe[50*50*2];

int qsort_comp(const void* x,const void* y) {
	const pipe_t* a=(const pipe_t*)x;
	const pipe_t* b=(const pipe_t*)y;
	if((a->length)>(b->length))return 1;
	if((a->length)<(b->length))return -1;
	if((a->a)>(b->a))return 1;
	if((a->a)<(b->a))return -1;
	if((a->b)>(b->b))return 1;
	if((a->b)<(b->b))return -1;
	return 0;
}

int main(void) {
	int hs_num,ds_num;
	int now;
	int i,j;
	int pos;
	int result;
	while(1) {
		scanf("%d%d",&hs_num,&ds_num);
		if(hs_num==0 && ds_num==0)break;
		pos=0;
		for(i=0;i<hs_num;i++) {
			for(j=0;j<ds_num;j++) {
				scanf("%d",&now);
				if(now>0) {
					pipe[pos].a=i;
					pipe[pos].b=hs_num+j;
					pipe[pos].length=now;
					pos++;
				}
			}
		}
		for(i=0;i<ds_num;i++) {
			for(j=i+1;j<ds_num;j++) {
				scanf("%d",&now);
				if(now>0) {
					pipe[pos].a=hs_num+i;
					pipe[pos].b=hs_num+j;
					pipe[pos].length=now;
					pos++;
				}
			}
		}
		qsort(pipe,pos,sizeof(pipe_t),qsort_comp);
		uf_init();
		for(i=1;i<hs_num;i++)uf_merge(i-1,i);
		result=0;
		for(i=0,now=0;i<pos && now<ds_num;i++) {
			if(!uf_issame(pipe[i].a,pipe[i].b)) {
				uf_merge(pipe[i].a,pipe[i].b);
				result+=pipe[i].length;
				now++;
			}
		}
		printf("%d\n",result);
	}
	return 0;
}
3 5
12 8 25 19 44
9 13 16 0 17
20 14 16 10 22
17 27 18 16
9 7 0
19 5
21
0 0
 3 5
12 15 70 19 44
9 13 16 0 17
20 14 16 10 22
17 27 18 16
9 7 0
19 5
21
0 0
 3 5
12 8 25 19 23
9 13 16 0 17
20 9 16 10 22
17 27 18 16
1 7 0
19 5
21
0 0
 3 5
12 15 70 19 44
16 13 16 0 17
20 14 16 10 22
17 27 18 16
9 7 0
19 5
21
0 0
 3 5
12 8 44 19 44
5 13 16 0 17
20 8 16 10 22
17 21 18 16
9 7 0
19 5
21
0 0
 3 5
12 8 30 19 44
5 13 16 0 17
20 8 16 10 22
17 21 18 16
9 12 0
19 5
21
0 0
 3 5
12 8 30 19 44
5 13 16 0 8
20 8 16 10 22
17 21 18 16
9 12 0
19 5
21
0 0
 3 5
12 8 30 19 44
5 12 16 0 8
20 8 16 10 22
17 21 18 16
7 12 0
19 5
21
0 0
 3 5
12 8 30 19 44
6 12 16 0 8
30 8 16 10 22
17 21 18 16
7 12 0
19 2
21
0 0
 3 5
12 8 30 19 44
6 12 16 0 8
30 8 16 4 22
17 21 18 16
7 12 0
19 2
21
0 0

38
 40
 30
 43
 34
 37
 36
 35
 33
 27

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>
#include <stdlib.h>

/* not complete */

int uf_table[100];

void uf_init(void) {
	int i;
	for(i=0;i<100;i++)uf_table[i]=0;
}

void uf_merge(int a,int b) {
	int next;
	while(uf_table[a]>0) {
		next=uf_table[a]-1;
		if(uf_table[next]>0)uf_table[a]=uf_table[next];
		a=next;
	}
	while(uf_table[b]>0) {
		next=uf_table[b]-1;
		if(uf_table[next]>0)uf_table[b]=uf_table[next];
		b=next;
	}
	if(a!=b)uf_table[a]=b+1;
}

int uf_issame(int a,int b) {
	int next;
	while(uf_table[a]>0) {
		next=uf_table[a]-1;
		if(uf_table[next]>0)uf_table[a]=uf_table[next];
		a=next;
	}
	while(uf_table[b]>0) {
		next=uf_table[b]-1;
		if(uf_table[next]>0)uf_table[b]=uf_table[next];
		b=next;
	}
	return a==b;
}

typedef struct {
	int a,b;
	int length;
} pipe_t;

pipe_t pipe[50*50*2];

int qsort_comp(const void* x,const void* y) {
	const pipe_t* a=(const pipe_t*)x;
	const pipe_t* b=(const pipe_t*)y;
	if((a->length)>(b->length))return 1;
	if((a->length)<(b->length))return -1;
	if((a->a)>(b->a))return 1;
	if((a->a)<(b->a))return -1;
	if((a->b)>(b->b))return 1;
	if((a->b)<(b->b))return -1;
	return 0;
}

int main(void) {
	int hs_num,ds_num;
	int now;
	int i,j;
	int pos;
	int result;
	while(1) {
		scanf("%d%d",&hs_num,&ds_num);
		if(hs_num==0 && ds_num==0)break;
		pos=0;
		for(i=0;i<hs_num;i++) {
			for(j=0;j<ds_num;j++) {
				scanf("%d",&now);
				if(now>0) {
					pipe[pos].a=i;
					pipe[pos].b=hs_num+j;
					pipe[pos].length=now;
					pos++;
				}
			}
		}
		for(i=0;i<ds_num;i++) {
			for(j=i+1;j<ds_num;j++) {
				scanf("%d",&now);
				if(now>0) {
					pipe[pos].a=hs_num+i;
					pipe[pos].b=hs_num+j;
					pipe[pos].length=now;
					pos++;
				}
			}
		}
		qsort(pipe,pos,sizeof(pipe_t),qsort_comp);
		uf_init();
		for(i=1;i<hs_num;i++)uf_merge(i-1,i);
		result=0;
		for(i=0,now=0;i<pos && now<ds_num;i++) {
			if(!uf_issame(pipe[i].a,pipe[i].b)) {
				uf_merge(pipe[i].a,pipe[i].b);
				result+=pipe[i].length;
				now++;
			}
		}
		printf("%d\n",result);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	uf_table
	.bss
	.align 32
	.type	uf_table, @object
	.size	uf_table, 400
uf_table:
	.zero	400
	.text
	.globl	uf_init
	.type	uf_init, @function
uf_init:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -4(%rbp)
	jmp	.L2
.L3:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -4(%rbp)
.L2:
	cmpl	$99, -4(%rbp)
	jle	.L3
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	uf_init, .-uf_init
	.globl	uf_merge
	.type	uf_merge, @function
uf_merge:
.LFB7:
	.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	%esi, -24(%rbp)
	jmp	.L5
.L7:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	$1, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jle	.L6
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	uf_table(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L6:
	movl	-4(%rbp), %eax
	movl	%eax, -20(%rbp)
.L5:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jg	.L7
	jmp	.L8
.L10:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	$1, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jle	.L9
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	uf_table(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L9:
	movl	-4(%rbp), %eax
	movl	%eax, -24(%rbp)
.L8:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jg	.L10
	movl	-20(%rbp), %eax
	cmpl	-24(%rbp), %eax
	je	.L12
	movl	-24(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L12:
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	uf_merge, .-uf_merge
	.globl	uf_issame
	.type	uf_issame, @function
uf_issame:
.LFB8:
	.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	%esi, -24(%rbp)
	jmp	.L14
.L16:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	$1, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jle	.L15
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	uf_table(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L15:
	movl	-4(%rbp), %eax
	movl	%eax, -20(%rbp)
.L14:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jg	.L16
	jmp	.L17
.L19:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	$1, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jle	.L18
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	uf_table(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L18:
	movl	-4(%rbp), %eax
	movl	%eax, -24(%rbp)
.L17:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jg	.L19
	movl	-20(%rbp), %eax
	cmpl	-24(%rbp), %eax
	sete	%al
	movzbl	%al, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	uf_issame, .-uf_issame
	.globl	pipe
	.bss
	.align 32
	.type	pipe, @object
	.size	pipe, 60000
pipe:
	.zero	60000
	.text
	.globl	qsort_comp
	.type	qsort_comp, @function
qsort_comp:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	movl	8(%rax), %edx
	movq	-8(%rbp), %rax
	movl	8(%rax), %eax
	cmpl	%eax, %edx
	jle	.L22
	movl	$1, %eax
	jmp	.L23
.L22:
	movq	-16(%rbp), %rax
	movl	8(%rax), %edx
	movq	-8(%rbp), %rax
	movl	8(%rax), %eax
	cmpl	%eax, %edx
	jge	.L24
	movl	$-1, %eax
	jmp	.L23
.L24:
	movq	-16(%rbp), %rax
	movl	(%rax), %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jle	.L25
	movl	$1, %eax
	jmp	.L23
.L25:
	movq	-16(%rbp), %rax
	movl	(%rax), %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jge	.L26
	movl	$-1, %eax
	jmp	.L23
.L26:
	movq	-16(%rbp), %rax
	movl	4(%rax), %edx
	movq	-8(%rbp), %rax
	movl	4(%rax), %eax
	cmpl	%eax, %edx
	jle	.L27
	movl	$1, %eax
	jmp	.L23
.L27:
	movq	-16(%rbp), %rax
	movl	4(%rax), %edx
	movq	-8(%rbp), %rax
	movl	4(%rax), %eax
	cmpl	%eax, %edx
	jge	.L28
	movl	$-1, %eax
	jmp	.L23
.L28:
	movl	$0, %eax
.L23:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	qsort_comp, .-qsort_comp
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L48:
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	testl	%eax, %eax
	jne	.L30
	movl	-32(%rbp), %eax
	testl	%eax, %eax
	je	.L52
.L30:
	movl	$0, -16(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L32
.L36:
	movl	$0, -20(%rbp)
	jmp	.L33
.L35:
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	testl	%eax, %eax
	jle	.L34
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	pipe(%rip), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-36(%rbp), %edx
	movl	-20(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+pipe(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-28(%rbp), %edx
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	8+pipe(%rip), %rax
	movl	%edx, (%rcx,%rax)
	addl	$1, -16(%rbp)
.L34:
	addl	$1, -20(%rbp)
.L33:
	movl	-32(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L35
	addl	$1, -24(%rbp)
.L32:
	movl	-36(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L36
	movl	$0, -24(%rbp)
	jmp	.L37
.L41:
	movl	-24(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -20(%rbp)
	jmp	.L38
.L40:
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	testl	%eax, %eax
	jle	.L39
	movl	-36(%rbp), %edx
	movl	-24(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	pipe(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-36(%rbp), %edx
	movl	-20(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+pipe(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-28(%rbp), %edx
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	8+pipe(%rip), %rax
	movl	%edx, (%rcx,%rax)
	addl	$1, -16(%rbp)
.L39:
	addl	$1, -20(%rbp)
.L38:
	movl	-32(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L40
	addl	$1, -24(%rbp)
.L37:
	movl	-32(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L41
	movl	-16(%rbp), %eax
	cltq
	leaq	qsort_comp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$12, %edx
	movq	%rax, %rsi
	leaq	pipe(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	call	uf_init
	movl	$1, -24(%rbp)
	jmp	.L42
.L43:
	movl	-24(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	uf_merge
	addl	$1, -24(%rbp)
.L42:
	movl	-36(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L43
	movl	$0, -12(%rbp)
	movl	$0, -24(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L44
.L47:
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+pipe(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	pipe(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	uf_issame
	testl	%eax, %eax
	jne	.L45
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+pipe(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	pipe(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	uf_merge
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+pipe(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -12(%rbp)
	movl	-28(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -28(%rbp)
.L45:
	addl	$1, -24(%rbp)
.L44:
	movl	-24(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jge	.L46
	movl	-28(%rbp), %edx
	movl	-32(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L47
.L46:
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L48
.L52:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L50
	call	__stack_chk_fail@PLT
.L50:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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	uf_table
	.bss
	.align 32
	.type	uf_table, @object
	.size	uf_table, 400
uf_table:
	.zero	400
	.text
	.globl	uf_init
	.type	uf_init, @function
uf_init:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -4(%rbp)
	jmp	.L2
.L3:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -4(%rbp)
.L2:
	cmpl	$99, -4(%rbp)
	jle	.L3
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	uf_init, .-uf_init
	.globl	uf_merge
	.type	uf_merge, @function
uf_merge:
.LFB7:
	.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	%esi, -24(%rbp)
	jmp	.L5
.L7:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	$1, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jle	.L6
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	uf_table(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L6:
	movl	-4(%rbp), %eax
	movl	%eax, -20(%rbp)
.L5:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jg	.L7
	jmp	.L8
.L10:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	$1, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jle	.L9
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	uf_table(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L9:
	movl	-4(%rbp), %eax
	movl	%eax, -24(%rbp)
.L8:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jg	.L10
	movl	-20(%rbp), %eax
	cmpl	-24(%rbp), %eax
	je	.L12
	movl	-24(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L12:
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	uf_merge, .-uf_merge
	.globl	uf_issame
	.type	uf_issame, @function
uf_issame:
.LFB8:
	.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	%esi, -24(%rbp)
	jmp	.L14
.L16:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	$1, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jle	.L15
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	uf_table(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L15:
	movl	-4(%rbp), %eax
	movl	%eax, -20(%rbp)
.L14:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jg	.L16
	jmp	.L17
.L19:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	$1, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jle	.L18
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	uf_table(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L18:
	movl	-4(%rbp), %eax
	movl	%eax, -24(%rbp)
.L17:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uf_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jg	.L19
	movl	-20(%rbp), %eax
	cmpl	-24(%rbp), %eax
	sete	%al
	movzbl	%al, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	uf_issame, .-uf_issame
	.globl	pipe
	.bss
	.align 32
	.type	pipe, @object
	.size	pipe, 60000
pipe:
	.zero	60000
	.text
	.globl	qsort_comp
	.type	qsort_comp, @function
qsort_comp:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	movl	8(%rax), %edx
	movq	-8(%rbp), %rax
	movl	8(%rax), %eax
	cmpl	%eax, %edx
	jle	.L22
	movl	$1, %eax
	jmp	.L23
.L22:
	movq	-16(%rbp), %rax
	movl	8(%rax), %edx
	movq	-8(%rbp), %rax
	movl	8(%rax), %eax
	cmpl	%eax, %edx
	jge	.L24
	movl	$-1, %eax
	jmp	.L23
.L24:
	movq	-16(%rbp), %rax
	movl	(%rax), %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jle	.L25
	movl	$1, %eax
	jmp	.L23
.L25:
	movq	-16(%rbp), %rax
	movl	(%rax), %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jge	.L26
	movl	$-1, %eax
	jmp	.L23
.L26:
	movq	-16(%rbp), %rax
	movl	4(%rax), %edx
	movq	-8(%rbp), %rax
	movl	4(%rax), %eax
	cmpl	%eax, %edx
	jle	.L27
	movl	$1, %eax
	jmp	.L23
.L27:
	movq	-16(%rbp), %rax
	movl	4(%rax), %edx
	movq	-8(%rbp), %rax
	movl	4(%rax), %eax
	cmpl	%eax, %edx
	jge	.L28
	movl	$-1, %eax
	jmp	.L23
.L28:
	movl	$0, %eax
.L23:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	qsort_comp, .-qsort_comp
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L48:
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	testl	%eax, %eax
	jne	.L30
	movl	-32(%rbp), %eax
	testl	%eax, %eax
	je	.L52
.L30:
	movl	$0, -16(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L32
.L36:
	movl	$0, -20(%rbp)
	jmp	.L33
.L35:
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	testl	%eax, %eax
	jle	.L34
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	pipe(%rip), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-36(%rbp), %edx
	movl	-20(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+pipe(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-28(%rbp), %edx
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	8+pipe(%rip), %rax
	movl	%edx, (%rcx,%rax)
	addl	$1, -16(%rbp)
.L34:
	addl	$1, -20(%rbp)
.L33:
	movl	-32(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L35
	addl	$1, -24(%rbp)
.L32:
	movl	-36(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L36
	movl	$0, -24(%rbp)
	jmp	.L37
.L41:
	movl	-24(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -20(%rbp)
	jmp	.L38
.L40:
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	testl	%eax, %eax
	jle	.L39
	movl	-36(%rbp), %edx
	movl	-24(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	pipe(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-36(%rbp), %edx
	movl	-20(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+pipe(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-28(%rbp), %edx
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	8+pipe(%rip), %rax
	movl	%edx, (%rcx,%rax)
	addl	$1, -16(%rbp)
.L39:
	addl	$1, -20(%rbp)
.L38:
	movl	-32(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L40
	addl	$1, -24(%rbp)
.L37:
	movl	-32(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L41
	movl	-16(%rbp), %eax
	cltq
	leaq	qsort_comp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$12, %edx
	movq	%rax, %rsi
	leaq	pipe(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	call	uf_init
	movl	$1, -24(%rbp)
	jmp	.L42
.L43:
	movl	-24(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	uf_merge
	addl	$1, -24(%rbp)
.L42:
	movl	-36(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L43
	movl	$0, -12(%rbp)
	movl	$0, -24(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L44
.L47:
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+pipe(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	pipe(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	uf_issame
	testl	%eax, %eax
	jne	.L45
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+pipe(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	pipe(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	uf_merge
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+pipe(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -12(%rbp)
	movl	-28(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -28(%rbp)
.L45:
	addl	$1, -24(%rbp)
.L44:
	movl	-24(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jge	.L46
	movl	-28(%rbp), %edx
	movl	-32(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L47
.L46:
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L48
.L52:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L50
	call	__stack_chk_fail@PLT
.L50:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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:
