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>
#include <string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define INF ((1LL<<62)-(1LL<<31))
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define bit(n,m)(((n)>>(m))&1)
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
ll pom(ll a,ll n,int m){ll x=1;for(a%=m;n;n/=2)n&1?x=x*a%m:0,a=a*a%m;return x;}
//#define MOD 998244353
#define MOD 1000000007
#define invp(a,p)pom(a,p-2,p)


//union-find
#define UFLIMIT (1<<17)
int unicnt[UFLIMIT+10];//正ならcnt、非正なら根のindex
void ufinit(int n){rep(i,0,n)unicnt[i]=1;}
int root(int x){return unicnt[x]<=0?-(unicnt[x]=-root(-unicnt[x])):x;}
int same(int x,int y){return root(x)==root(y);}
void uni(int x,int y){if((x=root(x))==(y=root(y)))return;if(unicnt[x]<unicnt[y]){int t=x;x=y;y=t;}unicnt[x]+=unicnt[y];unicnt[y]=-x;}
#undef UFLIMIT

ll n,m;
int main(){
	scanf("%lld%lld",&n,&m);
	ll ans=n;
	ufinit(n);
	rep(i,0,m){
		ll x,y;
		scanf("%lld%lld%*lld",&x,&y);
		x--,y--;
		if(!same(x,y)){
			uni(x,y);
			ans--;
		}
	}
	printf("%lld",ans);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	upll
	.type	upll, @function
upll:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jl	.L2
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	setg	%al
	movzbl	%al, %eax
	jmp	.L4
.L2:
	movl	$-1, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	upll, .-upll
	.globl	downll
	.type	downll, @function
downll:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jl	.L6
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jle	.L7
	movl	$-1, %eax
	jmp	.L10
.L7:
	movl	$0, %eax
	jmp	.L10
.L6:
	movl	$1, %eax
.L10:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	downll, .-downll
	.globl	sortup
	.type	sortup, @function
sortup:
.LFB8:
	.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
	movq	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rsi
	movq	-8(%rbp), %rax
	leaq	upll(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	sortup, .-sortup
	.globl	sortdown
	.type	sortdown, @function
sortdown:
.LFB9:
	.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
	movq	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rsi
	movq	-8(%rbp), %rax
	leaq	downll(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	sortdown, .-sortdown
	.globl	pom
	.type	pom, @function
pom:
.LFB10:
	.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)
	movl	%edx, -36(%rbp)
	movq	$1, -8(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rcx
	movq	-24(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, -24(%rbp)
	jmp	.L14
.L17:
	movq	-32(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L16
	movq	-8(%rbp), %rax
	imulq	-24(%rbp), %rax
	movl	-36(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, -8(%rbp)
.L16:
	movq	-24(%rbp), %rax
	imulq	%rax, %rax
	movl	-36(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, -24(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -32(%rbp)
.L14:
	cmpq	$0, -32(%rbp)
	jne	.L17
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	pom, .-pom
	.globl	unicnt
	.bss
	.align 32
	.type	unicnt, @object
	.size	unicnt, 524328
unicnt:
	.zero	524328
	.text
	.globl	ufinit
	.type	ufinit, @function
ufinit:
.LFB11:
	.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)
	movq	$0, -8(%rbp)
	jmp	.L20
.L21:
	movq	-8(%rbp), %rax
	leaq	0(,%rax,4), %rdx
	leaq	unicnt(%rip), %rax
	movl	$1, (%rdx,%rax)
	addq	$1, -8(%rbp)
.L20:
	movl	-20(%rbp), %eax
	cltq
	cmpq	%rax, -8(%rbp)
	jl	.L21
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	ufinit, .-ufinit
	.globl	root
	.type	root, @function
root:
.LFB12:
	.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	unicnt(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jg	.L23
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	unicnt(%rip), %rax
	movl	(%rdx,%rax), %eax
	negl	%eax
	movl	%eax, %edi
	call	root
	negl	%eax
	movl	%eax, %ecx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	unicnt(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	unicnt(%rip), %rax
	movl	(%rdx,%rax), %eax
	negl	%eax
	jmp	.L25
.L23:
	movl	-4(%rbp), %eax
.L25:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	root, .-root
	.globl	same
	.type	same, @function
same:
.LFB13:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 3, -24
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	root
	movl	%eax, %ebx
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	call	root
	cmpl	%eax, %ebx
	sete	%al
	movzbl	%al, %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	same, .-same
	.globl	uni
	.type	uni, @function
uni:
.LFB14:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	root
	movl	%eax, -20(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	call	root
	movl	%eax, -24(%rbp)
	movl	-20(%rbp), %eax
	cmpl	-24(%rbp), %eax
	je	.L32
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	unicnt(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	unicnt(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L31
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -24(%rbp)
.L31:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	unicnt(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	unicnt(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	unicnt(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-20(%rbp), %eax
	negl	%eax
	movl	%eax, %ecx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	unicnt(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L28
.L32:
	nop
.L28:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	uni, .-uni
	.globl	n
	.bss
	.align 8
	.type	n, @object
	.size	n, 8
n:
	.zero	8
	.globl	m
	.align 8
	.type	m, @object
	.size	m, 8
m:
	.zero	8
	.section	.rodata
.LC0:
	.string	"%lld%lld"
.LC1:
	.string	"%lld%lld%*lld"
.LC2:
	.string	"%lld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB15:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	m(%rip), %rax
	movq	%rax, %rdx
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	n(%rip), %rax
	movq	%rax, -24(%rbp)
	movq	n(%rip), %rax
	movl	%eax, %edi
	call	ufinit
	movq	$0, -16(%rbp)
	jmp	.L34
.L36:
	leaq	-32(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-40(%rbp), %rax
	subq	$1, %rax
	movq	%rax, -40(%rbp)
	movq	-32(%rbp), %rax
	subq	$1, %rax
	movq	%rax, -32(%rbp)
	movq	-32(%rbp), %rax
	movl	%eax, %edx
	movq	-40(%rbp), %rax
	movl	%edx, %esi
	movl	%eax, %edi
	call	same
	testl	%eax, %eax
	jne	.L35
	movq	-32(%rbp), %rax
	movl	%eax, %edx
	movq	-40(%rbp), %rax
	movl	%edx, %esi
	movl	%eax, %edi
	call	uni
	subq	$1, -24(%rbp)
.L35:
	addq	$1, -16(%rbp)
.L34:
	movq	m(%rip), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L36
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L38
	call	__stack_chk_fail@PLT
.L38:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.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	upll
	.type	upll, @function
upll:
.LFB51:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rax
	cmpq	%rax, (%rdi)
	movl	$-1, %edx
	setg	%al
	movzbl	%al, %eax
	cmovl	%edx, %eax
	ret
	.cfi_endproc
.LFE51:
	.size	upll, .-upll
	.p2align 4
	.globl	downll
	.type	downll, @function
downll:
.LFB52:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rdx
	movl	$1, %eax
	cmpq	%rdx, (%rdi)
	jl	.L5
	setg	%al
	movzbl	%al, %eax
	negl	%eax
.L5:
	ret
	.cfi_endproc
.LFE52:
	.size	downll, .-downll
	.p2align 4
	.globl	sortup
	.type	sortup, @function
sortup:
.LFB53:
	.cfi_startproc
	endbr64
	movslq	%esi, %rsi
	leaq	upll(%rip), %rcx
	movl	$8, %edx
	jmp	qsort@PLT
	.cfi_endproc
.LFE53:
	.size	sortup, .-sortup
	.p2align 4
	.globl	sortdown
	.type	sortdown, @function
sortdown:
.LFB54:
	.cfi_startproc
	endbr64
	movslq	%esi, %rsi
	leaq	downll(%rip), %rcx
	movl	$8, %edx
	jmp	qsort@PLT
	.cfi_endproc
.LFE54:
	.size	sortdown, .-sortdown
	.p2align 4
	.globl	pom
	.type	pom, @function
pom:
.LFB55:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	movslq	%edx, %r8
	movl	$1, %r9d
	cqto
	idivq	%r8
	movq	%rdx, %rcx
	testq	%rsi, %rsi
	je	.L10
	.p2align 4,,10
	.p2align 3
.L13:
	testb	$1, %sil
	je	.L12
	movq	%r9, %rax
	imulq	%rcx, %rax
	cqto
	idivq	%r8
	movq	%rdx, %r9
.L12:
	imulq	%rcx, %rcx
	movq	%rcx, %rax
	cqto
	idivq	%r8
	movq	%rsi, %rax
	shrq	$63, %rax
	addq	%rax, %rsi
	sarq	%rsi
	movq	%rdx, %rcx
	jne	.L13
.L10:
	movq	%r9, %rax
	ret
	.cfi_endproc
.LFE55:
	.size	pom, .-pom
	.p2align 4
	.globl	ufinit
	.type	ufinit, @function
ufinit:
.LFB56:
	.cfi_startproc
	endbr64
	movslq	%edi, %rdi
	testq	%rdi, %rdi
	jle	.L19
	leaq	-1(%rdi), %rax
	cmpq	$2, %rax
	jbe	.L24
	movq	%rdi, %rdx
	leaq	unicnt(%rip), %rcx
	movdqa	.LC0(%rip), %xmm0
	shrq	$2, %rdx
	movq	%rcx, %rax
	salq	$4, %rdx
	addq	%rcx, %rdx
	.p2align 4,,10
	.p2align 3
.L22:
	movaps	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L22
	movq	%rdi, %rax
	andq	$-4, %rax
	testb	$3, %dil
	je	.L26
.L21:
	leaq	1(%rax), %rdx
	movl	$1, (%rcx,%rax,4)
	cmpq	%rdx, %rdi
	jle	.L19
	addq	$2, %rax
	movl	$1, (%rcx,%rdx,4)
	cmpq	%rax, %rdi
	jle	.L19
	movl	$1, (%rcx,%rax,4)
.L19:
	ret
	.p2align 4,,10
	.p2align 3
.L26:
	ret
.L24:
	xorl	%eax, %eax
	leaq	unicnt(%rip), %rcx
	jmp	.L21
	.cfi_endproc
.LFE56:
	.size	ufinit, .-ufinit
	.p2align 4
	.globl	root
	.type	root, @function
root:
.LFB57:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movslq	%edi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	unicnt(%rip), %rbx
	movq	%rbp, %rax
	movl	(%rbx,%rbp,4), %edx
	testl	%edx, %edx
	jle	.L32
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L32:
	.cfi_restore_state
	movl	%edx, %eax
	negl	%eax
	movslq	%eax, %r12
	movl	(%rbx,%r12,4), %edi
	testl	%edi, %edi
	jle	.L33
.L29:
	movl	%edx, (%rbx,%rbp,4)
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L33:
	.cfi_restore_state
	negl	%edi
	call	root
	movl	%eax, %edx
	negl	%edx
	movl	%edx, (%rbx,%r12,4)
	jmp	.L29
	.cfi_endproc
.LFE57:
	.size	root, .-root
	.p2align 4
	.globl	same
	.type	same, @function
same:
.LFB58:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movslq	%edi, %r8
	leaq	unicnt(%rip), %r9
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r8, %rcx
	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	(%r9,%r8,4), %eax
	testl	%eax, %eax
	jle	.L51
	movslq	%esi, %r8
	movl	(%r9,%r8,4), %eax
	testl	%eax, %eax
	jle	.L52
.L42:
	xorl	%eax, %eax
	cmpl	%ecx, %esi
	sete	%al
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	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
.L51:
	.cfi_restore_state
	movl	%eax, %ecx
	negl	%ecx
	movslq	%ecx, %r10
	movl	(%r9,%r10,4), %edx
	testl	%edx, %edx
	jle	.L53
.L36:
	movl	%eax, (%r9,%r8,4)
	movslq	%esi, %r8
	movl	(%r9,%r8,4), %eax
	testl	%eax, %eax
	jg	.L42
.L52:
	movl	%eax, %esi
	negl	%esi
	movslq	%esi, %r10
	movl	(%r9,%r10,4), %edx
	testl	%edx, %edx
	jle	.L54
.L43:
	movl	%eax, (%r9,%r8,4)
	jmp	.L42
	.p2align 4,,10
	.p2align 3
.L54:
	movl	%edx, %esi
	negl	%esi
	movslq	%esi, %r11
	movl	(%r9,%r11,4), %eax
	testl	%eax, %eax
	jle	.L55
.L44:
	movl	%edx, (%r9,%r10,4)
	movl	%edx, %eax
	jmp	.L43
	.p2align 4,,10
	.p2align 3
.L53:
	movl	%edx, %ecx
	negl	%ecx
	movslq	%ecx, %r11
	movl	(%r9,%r11,4), %eax
	testl	%eax, %eax
	jle	.L56
.L37:
	movl	%edx, (%r9,%r10,4)
	movl	%edx, %eax
	jmp	.L36
	.p2align 4,,10
	.p2align 3
.L56:
	movl	%eax, %ecx
	negl	%ecx
	movslq	%ecx, %rbx
	movl	(%r9,%rbx,4), %edx
	testl	%edx, %edx
	jle	.L57
.L38:
	movl	%eax, (%r9,%r11,4)
	movl	%eax, %edx
	jmp	.L37
	.p2align 4,,10
	.p2align 3
.L55:
	movl	%eax, %esi
	negl	%esi
	movslq	%esi, %rbx
	movl	(%r9,%rbx,4), %edx
	testl	%edx, %edx
	jle	.L58
.L45:
	movl	%eax, (%r9,%r11,4)
	movl	%eax, %edx
	jmp	.L44
.L57:
	movl	%edx, %ecx
	negl	%ecx
	movslq	%ecx, %rbp
	movl	(%r9,%rbp,4), %eax
	testl	%eax, %eax
	jle	.L59
.L39:
	movl	%edx, (%r9,%rbx,4)
	movl	%edx, %eax
	jmp	.L38
.L58:
	movl	%edx, %esi
	negl	%esi
	movslq	%esi, %rbp
	movl	(%r9,%rbp,4), %eax
	testl	%eax, %eax
	jle	.L60
.L46:
	movl	%edx, (%r9,%rbx,4)
	movl	%edx, %eax
	jmp	.L45
.L59:
	negl	%eax
	movslq	%eax, %r12
	movl	(%r9,%r12,4), %eax
	movq	%r12, %rcx
	testl	%eax, %eax
	jle	.L61
.L40:
	movl	%ecx, %edx
	negl	%edx
	movl	%edx, (%r9,%rbp,4)
	jmp	.L39
.L60:
	negl	%eax
	movslq	%eax, %r12
	movl	(%r9,%r12,4), %eax
	movq	%r12, %rsi
	testl	%eax, %eax
	jle	.L62
.L47:
	movl	%esi, %edx
	negl	%edx
	movl	%edx, (%r9,%rbp,4)
	jmp	.L46
.L61:
	negl	%eax
	movslq	%eax, %r13
	movl	(%r9,%r13,4), %eax
	movq	%r13, %rcx
	testl	%eax, %eax
	jle	.L63
.L41:
	movl	%ecx, %eax
	negl	%eax
	movl	%eax, (%r9,%r12,4)
	jmp	.L40
.L62:
	negl	%eax
	movslq	%eax, %r13
	movl	(%r9,%r13,4), %eax
	movq	%r13, %rsi
	testl	%eax, %eax
	jle	.L64
.L48:
	movl	%esi, %eax
	negl	%eax
	movl	%eax, (%r9,%r12,4)
	jmp	.L47
.L63:
	negl	%eax
	movl	%eax, %edi
	call	root
	movl	%eax, %ecx
	negl	%eax
	movl	%eax, (%r9,%r13,4)
	jmp	.L41
.L64:
	negl	%eax
	movl	%eax, %edi
	call	root
	movl	%eax, %esi
	negl	%eax
	movl	%eax, (%r9,%r13,4)
	jmp	.L48
	.cfi_endproc
.LFE58:
	.size	same, .-same
	.p2align 4
	.globl	uni
	.type	uni, @function
uni:
.LFB59:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	%esi, %ecx
	leaq	unicnt(%rip), %r9
	movslq	%edi, %rsi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movl	%edi, %r8d
	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	(%r9,%rsi,4), %eax
	testl	%eax, %eax
	jle	.L84
.L66:
	movslq	%ecx, %r10
	movl	(%r9,%r10,4), %eax
	testl	%eax, %eax
	jle	.L85
.L73:
	cmpl	%r8d, %ecx
	je	.L65
	movslq	%r8d, %rsi
	movslq	%ecx, %r10
	movl	(%r9,%rsi,4), %eax
	movl	(%r9,%r10,4), %edx
	cmpl	%edx, %eax
	jge	.L86
.L81:
	addl	%edx, %eax
	negl	%ecx
	movl	%eax, (%r9,%r10,4)
	movl	%ecx, (%r9,%rsi,4)
.L65:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	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
.L86:
	.cfi_restore_state
	movl	%edx, %esi
	movl	%r8d, %ecx
	movl	%eax, %edx
	movl	%esi, %eax
	movq	%r10, %rsi
	movslq	%r8d, %r10
	jmp	.L81
	.p2align 4,,10
	.p2align 3
.L85:
	movl	%eax, %ecx
	negl	%ecx
	movslq	%ecx, %rsi
	movl	(%r9,%rsi,4), %edx
	testl	%edx, %edx
	jle	.L87
.L74:
	movl	%eax, (%r9,%r10,4)
	jmp	.L73
	.p2align 4,,10
	.p2align 3
.L84:
	movl	%eax, %edi
	negl	%edi
	movslq	%edi, %r8
	movl	(%r9,%r8,4), %edx
	testl	%edx, %edx
	jle	.L88
.L67:
	movl	%eax, (%r9,%rsi,4)
	movl	%edi, %r8d
	jmp	.L66
	.p2align 4,,10
	.p2align 3
.L88:
	movl	%edx, %edi
	negl	%edi
	movslq	%edi, %r10
	movl	(%r9,%r10,4), %eax
	testl	%eax, %eax
	jle	.L89
.L68:
	movl	%edx, (%r9,%r8,4)
	movl	%edx, %eax
	jmp	.L67
	.p2align 4,,10
	.p2align 3
.L87:
	movl	%edx, %ecx
	negl	%ecx
	movslq	%ecx, %r11
	movl	(%r9,%r11,4), %eax
	testl	%eax, %eax
	jle	.L90
.L75:
	movl	%edx, (%r9,%rsi,4)
	movl	%edx, %eax
	jmp	.L74
	.p2align 4,,10
	.p2align 3
.L90:
	movl	%eax, %ecx
	negl	%ecx
	movslq	%ecx, %rbx
	movl	(%r9,%rbx,4), %edx
	testl	%edx, %edx
	jle	.L91
.L76:
	movl	%eax, (%r9,%r11,4)
	movl	%eax, %edx
	jmp	.L75
	.p2align 4,,10
	.p2align 3
.L89:
	movl	%eax, %edi
	negl	%edi
	movslq	%edi, %r11
	movl	(%r9,%r11,4), %edx
	testl	%edx, %edx
	jle	.L92
.L69:
	movl	%eax, (%r9,%r10,4)
	movl	%eax, %edx
	jmp	.L68
.L91:
	movl	%edx, %ecx
	negl	%ecx
	movslq	%ecx, %rbp
	movl	(%r9,%rbp,4), %eax
	testl	%eax, %eax
	jle	.L93
.L77:
	movl	%edx, (%r9,%rbx,4)
	movl	%edx, %eax
	jmp	.L76
.L92:
	movl	%edx, %edi
	negl	%edi
	movslq	%edi, %rbx
	movl	(%r9,%rbx,4), %eax
	testl	%eax, %eax
	jle	.L94
.L70:
	movl	%edx, (%r9,%r11,4)
	movl	%edx, %eax
	jmp	.L69
.L93:
	negl	%eax
	movslq	%eax, %r12
	movl	(%r9,%r12,4), %eax
	movq	%r12, %rcx
	testl	%eax, %eax
	jle	.L95
.L78:
	movl	%ecx, %edx
	negl	%edx
	movl	%edx, (%r9,%rbp,4)
	jmp	.L77
.L94:
	negl	%eax
	movslq	%eax, %rbp
	movl	(%r9,%rbp,4), %eax
	movq	%rbp, %rdi
	testl	%eax, %eax
	jle	.L96
.L71:
	movl	%edi, %edx
	negl	%edx
	movl	%edx, (%r9,%rbx,4)
	jmp	.L70
.L95:
	negl	%eax
	movslq	%eax, %r13
	movl	(%r9,%r13,4), %eax
	movq	%r13, %rcx
	testl	%eax, %eax
	jle	.L97
.L79:
	movl	%ecx, %eax
	negl	%eax
	movl	%eax, (%r9,%r12,4)
	jmp	.L78
.L96:
	negl	%eax
	movslq	%eax, %r12
	movl	(%r9,%r12,4), %eax
	movq	%r12, %rdi
	testl	%eax, %eax
	jle	.L98
.L72:
	movl	%edi, %eax
	negl	%eax
	movl	%eax, (%r9,%rbp,4)
	jmp	.L71
.L97:
	negl	%eax
	movl	%eax, %edi
	call	root
	movl	%eax, %ecx
	negl	%eax
	movl	%eax, (%r9,%r13,4)
	jmp	.L79
.L98:
	negl	%eax
	movl	%eax, %edi
	call	root
	movl	%eax, %edi
	negl	%eax
	movl	%eax, (%r9,%r12,4)
	jmp	.L72
	.cfi_endproc
.LFE59:
	.size	uni, .-uni
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%lld%lld"
.LC2:
	.string	"%lld%lld%*lld"
.LC3:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB60:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	m(%rip), %rdx
	leaq	n(%rip), %rsi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC1(%rip), %rdi
	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	$104, %rsp
	.cfi_def_cfa_offset 160
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	n(%rip), %r15
	movslq	%r15d, %rcx
	testq	%rcx, %rcx
	jle	.L106
	leaq	-1(%rcx), %rax
	cmpq	$2, %rax
	jbe	.L143
	movq	%rcx, %rdx
	leaq	unicnt(%rip), %rbx
	movdqa	.LC0(%rip), %xmm0
	shrq	$2, %rdx
	movq	%rbx, %rax
	salq	$4, %rdx
	addq	%rbx, %rdx
	.p2align 4,,10
	.p2align 3
.L104:
	movaps	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rax, %rdx
	jne	.L104
	movq	%rcx, %rax
	andq	$-4, %rax
	testb	$3, %cl
	je	.L106
.L103:
	leaq	1(%rax), %rdx
	movl	$1, (%rbx,%rax,4)
	cmpq	%rdx, %rcx
	jle	.L106
	addq	$2, %rax
	movl	$1, (%rbx,%rdx,4)
	cmpq	%rax, %rcx
	jle	.L106
	movl	$1, (%rbx,%rax,4)
.L106:
	cmpq	$0, m(%rip)
	jle	.L102
	xorl	%r14d, %r14d
	leaq	80(%rsp), %r13
	leaq	unicnt(%rip), %rbx
	leaq	72(%rsp), %r12
	leaq	.LC2(%rip), %rbp
	jmp	.L101
	.p2align 4,,10
	.p2align 3
.L108:
	movslq	%r11d, %r10
	movl	%r11d, %eax
	movl	(%rbx,%r10,4), %edx
	testl	%edx, %edx
	jle	.L149
.L116:
	cmpl	%ecx, %eax
	je	.L124
	movl	(%rbx,%r8,4), %eax
	testl	%eax, %eax
	jle	.L150
.L125:
	testl	%edx, %edx
	jle	.L151
.L132:
	cmpl	%r9d, %esi
	je	.L139
	movslq	%r9d, %rdx
	movslq	%esi, %rdi
	movl	(%rbx,%rdx,4), %ecx
	movl	(%rbx,%rdi,4), %eax
	cmpl	%eax, %ecx
	jl	.L140
	movl	%eax, %edx
	movl	%r9d, %esi
	movl	%ecx, %eax
	movl	%edx, %ecx
	movq	%rdi, %rdx
	movslq	%r9d, %rdi
.L140:
	addl	%ecx, %eax
	negl	%esi
	movl	%eax, (%rbx,%rdi,4)
	movl	%esi, (%rbx,%rdx,4)
.L139:
	subq	$1, %r15
.L124:
	addq	$1, %r14
	cmpq	%r14, m(%rip)
	jle	.L102
.L101:
	movq	%r12, %rsi
	movq	%r13, %rdx
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	80(%rsp), %rax
	leaq	-1(%rax), %r11
	movq	72(%rsp), %rax
	movl	%r11d, %esi
	leaq	-1(%rax), %rcx
	movslq	%ecx, %r8
	movl	%ecx, %r9d
	movl	(%rbx,%r8,4), %eax
	testl	%eax, %eax
	jg	.L108
	movl	%eax, %ecx
	negl	%ecx
	movslq	%ecx, %r10
	movl	(%rbx,%r10,4), %edx
	testl	%edx, %edx
	jle	.L152
.L109:
	movslq	%r11d, %r10
	movl	%eax, (%rbx,%r8,4)
	movl	%r11d, %eax
	movl	(%rbx,%r10,4), %edx
	testl	%edx, %edx
	jg	.L116
.L149:
	movl	%edx, %eax
	negl	%eax
	movslq	%eax, %r11
	movl	(%rbx,%r11,4), %edi
	testl	%edi, %edi
	jle	.L153
.L117:
	movl	%edx, (%rbx,%r10,4)
	jmp	.L116
	.p2align 4,,10
	.p2align 3
.L151:
	movl	%edx, %esi
	negl	%esi
	movslq	%esi, %rcx
	movl	(%rbx,%rcx,4), %eax
	testl	%eax, %eax
	jle	.L154
.L133:
	movl	%edx, (%rbx,%r10,4)
	jmp	.L132
	.p2align 4,,10
	.p2align 3
.L150:
	movl	%eax, %r9d
	negl	%r9d
	movslq	%r9d, %rcx
	movl	(%rbx,%rcx,4), %edx
	testl	%edx, %edx
	jle	.L155
.L126:
	movl	%eax, (%rbx,%r8,4)
	movl	(%rbx,%r10,4), %edx
	jmp	.L125
	.p2align 4,,10
	.p2align 3
.L102:
	xorl	%eax, %eax
	movq	%r15, %rdx
	movl	$1, %edi
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L156
	addq	$104, %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
.L153:
	.cfi_restore_state
	movl	%edi, %eax
	negl	%eax
	movslq	%eax, %rdx
	movl	(%rbx,%rdx,4), %edi
	testl	%edi, %edi
	jle	.L157
.L118:
	movl	%eax, %edx
	negl	%edx
	movl	%edx, (%rbx,%r11,4)
	jmp	.L117
.L152:
	negl	%edx
	movslq	%edx, %rcx
	movl	(%rbx,%rcx,4), %eax
	testl	%eax, %eax
	jle	.L158
.L110:
	movl	%edx, %eax
	movl	%edx, %ecx
	negl	%eax
	movl	%eax, (%rbx,%r10,4)
	jmp	.L109
.L155:
	negl	%edx
	movslq	%edx, %r11
	movl	(%rbx,%r11,4), %eax
	movq	%r11, %r9
	testl	%eax, %eax
	jle	.L159
.L127:
	movl	%r9d, %eax
	negl	%eax
	movl	%eax, (%rbx,%rcx,4)
	jmp	.L126
.L154:
	negl	%eax
	movslq	%eax, %r8
	movl	(%rbx,%r8,4), %eax
	movq	%r8, %rsi
	testl	%eax, %eax
	jle	.L160
.L134:
	movl	%esi, %edx
	negl	%edx
	movl	%edx, (%rbx,%rcx,4)
	jmp	.L133
.L158:
	negl	%eax
	movslq	%eax, %rdx
	movl	(%rbx,%rdx,4), %edi
	testl	%edi, %edi
	jle	.L161
.L111:
	movl	%eax, %edx
	negl	%edx
	movl	%edx, (%rbx,%rcx,4)
	movl	%eax, %edx
	jmp	.L110
.L157:
	negl	%edi
	movslq	%edi, %rax
	movq	%rax, 8(%rsp)
	movl	(%rbx,%rax,4), %eax
	testl	%eax, %eax
	jle	.L162
.L119:
	movl	%edi, %eax
	negl	%eax
	movl	%eax, (%rbx,%rdx,4)
	movl	%edi, %eax
	jmp	.L118
.L159:
	negl	%eax
	movslq	%eax, %r9
	movl	(%rbx,%r9,4), %edx
	testl	%edx, %edx
	jle	.L163
.L128:
	movl	%eax, %edx
	movl	%eax, %r9d
	negl	%edx
	movl	%edx, (%rbx,%r11,4)
	jmp	.L127
.L160:
	negl	%eax
	movslq	%eax, %rsi
	movl	(%rbx,%rsi,4), %edx
	testl	%edx, %edx
	jle	.L164
.L135:
	movl	%eax, %edx
	movl	%eax, %esi
	negl	%edx
	movl	%edx, (%rbx,%r8,4)
	jmp	.L134
.L143:
	xorl	%eax, %eax
	leaq	unicnt(%rip), %rbx
	jmp	.L103
.L164:
	movl	%edx, %eax
	negl	%eax
	movslq	%eax, %rdi
	movl	(%rbx,%rdi,4), %edx
	movq	%rdi, 8(%rsp)
	testl	%edx, %edx
	jle	.L165
.L136:
	movl	%eax, %edx
	negl	%edx
	movl	%edx, (%rbx,%rsi,4)
	jmp	.L135
.L163:
	movl	%edx, %eax
	negl	%eax
	movslq	%eax, %rdi
	movl	(%rbx,%rdi,4), %edx
	movq	%rdi, 8(%rsp)
	testl	%edx, %edx
	jle	.L166
.L129:
	movl	%eax, %edx
	negl	%edx
	movl	%edx, (%rbx,%r9,4)
	jmp	.L128
.L161:
	negl	%edi
	movslq	%edi, %rax
	movq	%rax, 16(%rsp)
	movl	(%rbx,%rax,4), %eax
	testl	%eax, %eax
	jle	.L167
.L112:
	movl	%edi, %eax
	negl	%eax
	movl	%eax, (%rbx,%rdx,4)
	movl	%edi, %eax
	jmp	.L111
.L162:
	negl	%eax
	movslq	%eax, %rdi
	movl	%eax, 16(%rsp)
	movq	%rdi, 24(%rsp)
	movl	(%rbx,%rdi,4), %edi
	testl	%edi, %edi
	jle	.L168
.L120:
	movl	16(%rsp), %edi
	movq	8(%rsp), %rax
	negl	%edi
	movl	%edi, (%rbx,%rax,4)
	movl	16(%rsp), %edi
	jmp	.L119
.L167:
	negl	%eax
	movslq	%eax, %rdi
	movl	%eax, 8(%rsp)
	movq	%rdi, 32(%rsp)
	movl	(%rbx,%rdi,4), %edi
	testl	%edi, %edi
	jle	.L169
.L113:
	movl	8(%rsp), %edi
	movq	16(%rsp), %rax
	negl	%edi
	movl	%edi, (%rbx,%rax,4)
	movl	8(%rsp), %edi
	jmp	.L112
.L168:
	movl	%edi, %eax
	negl	%eax
	movl	%eax, 16(%rsp)
	cltq
	movq	%rax, 40(%rsp)
	movl	(%rbx,%rax,4), %eax
	testl	%eax, %eax
	jle	.L170
.L121:
	movl	16(%rsp), %eax
	movq	24(%rsp), %rdi
	negl	%eax
	movl	%eax, (%rbx,%rdi,4)
	jmp	.L120
.L166:
	negl	%edx
	movslq	%edx, %rax
	movq	%rax, 16(%rsp)
	movl	(%rbx,%rax,4), %eax
	testl	%eax, %eax
	jle	.L171
.L130:
	movq	8(%rsp), %rdi
	movl	%edx, %eax
	negl	%eax
	movl	%eax, (%rbx,%rdi,4)
	movl	%edx, %eax
	jmp	.L129
.L165:
	movl	%edx, %eax
	negl	%eax
	movslq	%eax, %r11
	movl	(%rbx,%r11,4), %edx
	testl	%edx, %edx
	jle	.L172
.L137:
	movq	8(%rsp), %rdi
	movl	%eax, %edx
	negl	%edx
	movl	%edx, (%rbx,%rdi,4)
	jmp	.L136
.L170:
	negl	%eax
	movl	%eax, 16(%rsp)
	cltq
	movq	%rax, 48(%rsp)
	movl	(%rbx,%rax,4), %eax
	testl	%eax, %eax
	jle	.L173
.L122:
	movl	16(%rsp), %eax
	movq	40(%rsp), %rdi
	negl	%eax
	movl	%eax, (%rbx,%rdi,4)
	jmp	.L121
.L169:
	movl	%edi, %eax
	negl	%eax
	movl	%eax, 8(%rsp)
	cltq
	movq	%rax, 40(%rsp)
	movl	(%rbx,%rax,4), %eax
	testl	%eax, %eax
	jle	.L174
.L114:
	movl	8(%rsp), %eax
	movq	32(%rsp), %rdi
	negl	%eax
	movl	%eax, (%rbx,%rdi,4)
	jmp	.L113
.L172:
	movl	%edx, %eax
	negl	%eax
	movslq	%eax, %rdx
	movl	(%rbx,%rdx,4), %edi
	testl	%edi, %edi
	jle	.L175
.L138:
	movl	%eax, %edx
	negl	%edx
	movl	%edx, (%rbx,%r11,4)
	jmp	.L137
.L171:
	negl	%eax
	movslq	%eax, %rdx
	movl	(%rbx,%rdx,4), %edi
	testl	%edi, %edi
	jle	.L176
.L131:
	movq	16(%rsp), %rdi
	movl	%eax, %edx
	negl	%edx
	movl	%edx, (%rbx,%rdi,4)
	movl	%eax, %edx
	jmp	.L130
.L174:
	negl	%eax
	movslq	%eax, %rdi
	movl	%eax, 8(%rsp)
	movq	%rdi, 24(%rsp)
	movl	(%rbx,%rdi,4), %edi
	testl	%edi, %edi
	jle	.L177
.L115:
	movl	8(%rsp), %edi
	movq	40(%rsp), %rax
	negl	%edi
	movl	%edi, (%rbx,%rax,4)
	jmp	.L114
.L173:
	negl	%eax
	movslq	%eax, %rdi
	movl	%eax, 16(%rsp)
	movq	%rdi, 32(%rsp)
	movl	(%rbx,%rdi,4), %edi
	testl	%edi, %edi
	jle	.L178
.L123:
	movl	16(%rsp), %edi
	movq	48(%rsp), %rax
	negl	%edi
	movl	%edi, (%rbx,%rax,4)
	jmp	.L122
.L156:
	call	__stack_chk_fail@PLT
.L175:
	negl	%edi
	movq	%rdx, 16(%rsp)
	call	root
	movq	16(%rsp), %rdx
	movl	%eax, %edi
	negl	%edi
	movl	%edi, (%rbx,%rdx,4)
	jmp	.L138
.L177:
	negl	%edi
	movq	%rdx, 48(%rsp)
	call	root
	movq	24(%rsp), %rdx
	movl	%eax, %edi
	movl	%eax, 8(%rsp)
	negl	%edi
	movl	%edi, (%rbx,%rdx,4)
	movq	48(%rsp), %rdx
	jmp	.L115
.L176:
	negl	%edi
	movq	%rdx, 24(%rsp)
	call	root
	movq	24(%rsp), %rdx
	movl	%eax, %edi
	negl	%edi
	movl	%edi, (%rbx,%rdx,4)
	jmp	.L131
.L178:
	negl	%edi
	movq	%rdx, 56(%rsp)
	call	root
	movq	32(%rsp), %rdx
	movl	%eax, %edi
	movl	%eax, 16(%rsp)
	negl	%edi
	movl	%edi, (%rbx,%rdx,4)
	movq	56(%rsp), %rdx
	jmp	.L123
	.cfi_endproc
.LFE60:
	.size	main, .-main
	.globl	m
	.bss
	.align 8
	.type	m, @object
	.size	m, 8
m:
	.zero	8
	.globl	n
	.align 8
	.type	n, @object
	.size	n, 8
n:
	.zero	8
	.globl	unicnt
	.align 32
	.type	unicnt, @object
	.size	unicnt, 524328
unicnt:
	.zero	524328
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1
	.long	1
	.long	1
	.long	1
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	upll
	.type	upll, @function
upll:
.LFB51:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rax
	cmpq	%rax, (%rdi)
	movl	$-1, %edx
	setg	%al
	movzbl	%al, %eax
	cmovl	%edx, %eax
	ret
	.cfi_endproc
.LFE51:
	.size	upll, .-upll
	.p2align 4
	.globl	downll
	.type	downll, @function
downll:
.LFB52:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rdx
	movl	$1, %eax
	cmpq	%rdx, (%rdi)
	jl	.L5
	setg	%al
	movzbl	%al, %eax
	negl	%eax
.L5:
	ret
	.cfi_endproc
.LFE52:
	.size	downll, .-downll
	.p2align 4
	.globl	sortup
	.type	sortup, @function
sortup:
.LFB53:
	.cfi_startproc
	endbr64
	movslq	%esi, %rsi
	leaq	upll(%rip), %rcx
	movl	$8, %edx
	jmp	qsort@PLT
	.cfi_endproc
.LFE53:
	.size	sortup, .-sortup
	.p2align 4
	.globl	sortdown
	.type	sortdown, @function
sortdown:
.LFB54:
	.cfi_startproc
	endbr64
	movslq	%esi, %rsi
	leaq	downll(%rip), %rcx
	movl	$8, %edx
	jmp	qsort@PLT
	.cfi_endproc
.LFE54:
	.size	sortdown, .-sortdown
	.p2align 4
	.globl	pom
	.type	pom, @function
pom:
.LFB55:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	movslq	%edx, %r8
	movl	$1, %r9d
	cqto
	idivq	%r8
	movq	%rdx, %rcx
	testq	%rsi, %rsi
	je	.L10
	.p2align 4,,10
	.p2align 3
.L13:
	testb	$1, %sil
	je	.L12
	movq	%r9, %rax
	imulq	%rcx, %rax
	cqto
	idivq	%r8
	movq	%rdx, %r9
.L12:
	imulq	%rcx, %rcx
	movq	%rcx, %rax
	cqto
	idivq	%r8
	movq	%rsi, %rax
	shrq	$63, %rax
	addq	%rax, %rsi
	sarq	%rsi
	movq	%rdx, %rcx
	jne	.L13
.L10:
	movq	%r9, %rax
	ret
	.cfi_endproc
.LFE55:
	.size	pom, .-pom
	.p2align 4
	.globl	ufinit
	.type	ufinit, @function
ufinit:
.LFB56:
	.cfi_startproc
	endbr64
	movslq	%edi, %rdi
	testq	%rdi, %rdi
	jle	.L19
	leaq	-1(%rdi), %rax
	cmpq	$2, %rax
	jbe	.L24
	movq	%rdi, %rdx
	leaq	unicnt(%rip), %rcx
	movdqa	.LC0(%rip), %xmm0
	shrq	$2, %rdx
	movq	%rcx, %rax
	salq	$4, %rdx
	addq	%rcx, %rdx
	.p2align 4,,10
	.p2align 3
.L22:
	movaps	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L22
	movq	%rdi, %rax
	andq	$-4, %rax
	testb	$3, %dil
	je	.L26
.L21:
	leaq	1(%rax), %rdx
	movl	$1, (%rcx,%rax,4)
	cmpq	%rdx, %rdi
	jle	.L19
	addq	$2, %rax
	movl	$1, (%rcx,%rdx,4)
	cmpq	%rax, %rdi
	jle	.L19
	movl	$1, (%rcx,%rax,4)
.L19:
	ret
	.p2align 4,,10
	.p2align 3
.L26:
	ret
.L24:
	xorl	%eax, %eax
	leaq	unicnt(%rip), %rcx
	jmp	.L21
	.cfi_endproc
.LFE56:
	.size	ufinit, .-ufinit
	.p2align 4
	.globl	root
	.type	root, @function
root:
.LFB57:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movslq	%edi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	unicnt(%rip), %rbx
	movq	%rbp, %rax
	movl	(%rbx,%rbp,4), %edx
	testl	%edx, %edx
	jle	.L32
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L32:
	.cfi_restore_state
	movl	%edx, %eax
	negl	%eax
	movslq	%eax, %r12
	movl	(%rbx,%r12,4), %edi
	testl	%edi, %edi
	jle	.L33
.L29:
	movl	%edx, (%rbx,%rbp,4)
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L33:
	.cfi_restore_state
	negl	%edi
	call	root
	movl	%eax, %edx
	negl	%edx
	movl	%edx, (%rbx,%r12,4)
	jmp	.L29
	.cfi_endproc
.LFE57:
	.size	root, .-root
	.p2align 4
	.globl	same
	.type	same, @function
same:
.LFB58:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movslq	%edi, %r8
	leaq	unicnt(%rip), %r9
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r8, %rcx
	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	(%r9,%r8,4), %eax
	testl	%eax, %eax
	jle	.L51
	movslq	%esi, %r8
	movl	(%r9,%r8,4), %eax
	testl	%eax, %eax
	jle	.L52
.L42:
	xorl	%eax, %eax
	cmpl	%ecx, %esi
	sete	%al
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	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
.L51:
	.cfi_restore_state
	movl	%eax, %ecx
	negl	%ecx
	movslq	%ecx, %r10
	movl	(%r9,%r10,4), %edx
	testl	%edx, %edx
	jle	.L53
.L36:
	movl	%eax, (%r9,%r8,4)
	movslq	%esi, %r8
	movl	(%r9,%r8,4), %eax
	testl	%eax, %eax
	jg	.L42
.L52:
	movl	%eax, %esi
	negl	%esi
	movslq	%esi, %r10
	movl	(%r9,%r10,4), %edx
	testl	%edx, %edx
	jle	.L54
.L43:
	movl	%eax, (%r9,%r8,4)
	jmp	.L42
	.p2align 4,,10
	.p2align 3
.L54:
	movl	%edx, %esi
	negl	%esi
	movslq	%esi, %r11
	movl	(%r9,%r11,4), %eax
	testl	%eax, %eax
	jle	.L55
.L44:
	movl	%edx, (%r9,%r10,4)
	movl	%edx, %eax
	jmp	.L43
	.p2align 4,,10
	.p2align 3
.L53:
	movl	%edx, %ecx
	negl	%ecx
	movslq	%ecx, %r11
	movl	(%r9,%r11,4), %eax
	testl	%eax, %eax
	jle	.L56
.L37:
	movl	%edx, (%r9,%r10,4)
	movl	%edx, %eax
	jmp	.L36
	.p2align 4,,10
	.p2align 3
.L56:
	movl	%eax, %ecx
	negl	%ecx
	movslq	%ecx, %rbx
	movl	(%r9,%rbx,4), %edx
	testl	%edx, %edx
	jle	.L57
.L38:
	movl	%eax, (%r9,%r11,4)
	movl	%eax, %edx
	jmp	.L37
	.p2align 4,,10
	.p2align 3
.L55:
	movl	%eax, %esi
	negl	%esi
	movslq	%esi, %rbx
	movl	(%r9,%rbx,4), %edx
	testl	%edx, %edx
	jle	.L58
.L45:
	movl	%eax, (%r9,%r11,4)
	movl	%eax, %edx
	jmp	.L44
.L57:
	movl	%edx, %ecx
	negl	%ecx
	movslq	%ecx, %rbp
	movl	(%r9,%rbp,4), %eax
	testl	%eax, %eax
	jle	.L59
.L39:
	movl	%edx, (%r9,%rbx,4)
	movl	%edx, %eax
	jmp	.L38
.L58:
	movl	%edx, %esi
	negl	%esi
	movslq	%esi, %rbp
	movl	(%r9,%rbp,4), %eax
	testl	%eax, %eax
	jle	.L60
.L46:
	movl	%edx, (%r9,%rbx,4)
	movl	%edx, %eax
	jmp	.L45
.L59:
	negl	%eax
	movslq	%eax, %r12
	movl	(%r9,%r12,4), %eax
	movq	%r12, %rcx
	testl	%eax, %eax
	jle	.L61
.L40:
	movl	%ecx, %edx
	negl	%edx
	movl	%edx, (%r9,%rbp,4)
	jmp	.L39
.L60:
	negl	%eax
	movslq	%eax, %r12
	movl	(%r9,%r12,4), %eax
	movq	%r12, %rsi
	testl	%eax, %eax
	jle	.L62
.L47:
	movl	%esi, %edx
	negl	%edx
	movl	%edx, (%r9,%rbp,4)
	jmp	.L46
.L61:
	negl	%eax
	movslq	%eax, %r13
	movl	(%r9,%r13,4), %eax
	movq	%r13, %rcx
	testl	%eax, %eax
	jle	.L63
.L41:
	movl	%ecx, %eax
	negl	%eax
	movl	%eax, (%r9,%r12,4)
	jmp	.L40
.L62:
	negl	%eax
	movslq	%eax, %r13
	movl	(%r9,%r13,4), %eax
	movq	%r13, %rsi
	testl	%eax, %eax
	jle	.L64
.L48:
	movl	%esi, %eax
	negl	%eax
	movl	%eax, (%r9,%r12,4)
	jmp	.L47
.L63:
	negl	%eax
	movl	%eax, %edi
	call	root
	movl	%eax, %ecx
	negl	%eax
	movl	%eax, (%r9,%r13,4)
	jmp	.L41
.L64:
	negl	%eax
	movl	%eax, %edi
	call	root
	movl	%eax, %esi
	negl	%eax
	movl	%eax, (%r9,%r13,4)
	jmp	.L48
	.cfi_endproc
.LFE58:
	.size	same, .-same
	.p2align 4
	.globl	uni
	.type	uni, @function
uni:
.LFB59:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	%esi, %ecx
	leaq	unicnt(%rip), %r9
	movslq	%edi, %rsi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movl	%edi, %r8d
	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	(%r9,%rsi,4), %eax
	testl	%eax, %eax
	jle	.L84
.L66:
	movslq	%ecx, %r10
	movl	(%r9,%r10,4), %eax
	testl	%eax, %eax
	jle	.L85
.L73:
	cmpl	%r8d, %ecx
	je	.L65
	movslq	%r8d, %rsi
	movslq	%ecx, %r10
	movl	(%r9,%rsi,4), %eax
	movl	(%r9,%r10,4), %edx
	cmpl	%edx, %eax
	jge	.L86
.L81:
	addl	%edx, %eax
	negl	%ecx
	movl	%eax, (%r9,%r10,4)
	movl	%ecx, (%r9,%rsi,4)
.L65:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	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
.L86:
	.cfi_restore_state
	movl	%edx, %esi
	movl	%r8d, %ecx
	movl	%eax, %edx
	movl	%esi, %eax
	movq	%r10, %rsi
	movslq	%r8d, %r10
	jmp	.L81
	.p2align 4,,10
	.p2align 3
.L85:
	movl	%eax, %ecx
	negl	%ecx
	movslq	%ecx, %rsi
	movl	(%r9,%rsi,4), %edx
	testl	%edx, %edx
	jle	.L87
.L74:
	movl	%eax, (%r9,%r10,4)
	jmp	.L73
	.p2align 4,,10
	.p2align 3
.L84:
	movl	%eax, %edi
	negl	%edi
	movslq	%edi, %r8
	movl	(%r9,%r8,4), %edx
	testl	%edx, %edx
	jle	.L88
.L67:
	movl	%eax, (%r9,%rsi,4)
	movl	%edi, %r8d
	jmp	.L66
	.p2align 4,,10
	.p2align 3
.L88:
	movl	%edx, %edi
	negl	%edi
	movslq	%edi, %r10
	movl	(%r9,%r10,4), %eax
	testl	%eax, %eax
	jle	.L89
.L68:
	movl	%edx, (%r9,%r8,4)
	movl	%edx, %eax
	jmp	.L67
	.p2align 4,,10
	.p2align 3
.L87:
	movl	%edx, %ecx
	negl	%ecx
	movslq	%ecx, %r11
	movl	(%r9,%r11,4), %eax
	testl	%eax, %eax
	jle	.L90
.L75:
	movl	%edx, (%r9,%rsi,4)
	movl	%edx, %eax
	jmp	.L74
	.p2align 4,,10
	.p2align 3
.L90:
	movl	%eax, %ecx
	negl	%ecx
	movslq	%ecx, %rbx
	movl	(%r9,%rbx,4), %edx
	testl	%edx, %edx
	jle	.L91
.L76:
	movl	%eax, (%r9,%r11,4)
	movl	%eax, %edx
	jmp	.L75
	.p2align 4,,10
	.p2align 3
.L89:
	movl	%eax, %edi
	negl	%edi
	movslq	%edi, %r11
	movl	(%r9,%r11,4), %edx
	testl	%edx, %edx
	jle	.L92
.L69:
	movl	%eax, (%r9,%r10,4)
	movl	%eax, %edx
	jmp	.L68
.L91:
	movl	%edx, %ecx
	negl	%ecx
	movslq	%ecx, %rbp
	movl	(%r9,%rbp,4), %eax
	testl	%eax, %eax
	jle	.L93
.L77:
	movl	%edx, (%r9,%rbx,4)
	movl	%edx, %eax
	jmp	.L76
.L92:
	movl	%edx, %edi
	negl	%edi
	movslq	%edi, %rbx
	movl	(%r9,%rbx,4), %eax
	testl	%eax, %eax
	jle	.L94
.L70:
	movl	%edx, (%r9,%r11,4)
	movl	%edx, %eax
	jmp	.L69
.L93:
	negl	%eax
	movslq	%eax, %r12
	movl	(%r9,%r12,4), %eax
	movq	%r12, %rcx
	testl	%eax, %eax
	jle	.L95
.L78:
	movl	%ecx, %edx
	negl	%edx
	movl	%edx, (%r9,%rbp,4)
	jmp	.L77
.L94:
	negl	%eax
	movslq	%eax, %rbp
	movl	(%r9,%rbp,4), %eax
	movq	%rbp, %rdi
	testl	%eax, %eax
	jle	.L96
.L71:
	movl	%edi, %edx
	negl	%edx
	movl	%edx, (%r9,%rbx,4)
	jmp	.L70
.L95:
	negl	%eax
	movslq	%eax, %r13
	movl	(%r9,%r13,4), %eax
	movq	%r13, %rcx
	testl	%eax, %eax
	jle	.L97
.L79:
	movl	%ecx, %eax
	negl	%eax
	movl	%eax, (%r9,%r12,4)
	jmp	.L78
.L96:
	negl	%eax
	movslq	%eax, %r12
	movl	(%r9,%r12,4), %eax
	movq	%r12, %rdi
	testl	%eax, %eax
	jle	.L98
.L72:
	movl	%edi, %eax
	negl	%eax
	movl	%eax, (%r9,%rbp,4)
	jmp	.L71
.L97:
	negl	%eax
	movl	%eax, %edi
	call	root
	movl	%eax, %ecx
	negl	%eax
	movl	%eax, (%r9,%r13,4)
	jmp	.L79
.L98:
	negl	%eax
	movl	%eax, %edi
	call	root
	movl	%eax, %edi
	negl	%eax
	movl	%eax, (%r9,%r12,4)
	jmp	.L72
	.cfi_endproc
.LFE59:
	.size	uni, .-uni
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%lld%lld"
.LC2:
	.string	"%lld%lld%*lld"
.LC3:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB60:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	m(%rip), %rdx
	leaq	n(%rip), %rsi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC1(%rip), %rdi
	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	$104, %rsp
	.cfi_def_cfa_offset 160
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	n(%rip), %r15
	movslq	%r15d, %rcx
	testq	%rcx, %rcx
	jle	.L106
	leaq	-1(%rcx), %rax
	cmpq	$2, %rax
	jbe	.L143
	movq	%rcx, %rdx
	leaq	unicnt(%rip), %rbx
	movdqa	.LC0(%rip), %xmm0
	shrq	$2, %rdx
	movq	%rbx, %rax
	salq	$4, %rdx
	addq	%rbx, %rdx
	.p2align 4,,10
	.p2align 3
.L104:
	movaps	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rax, %rdx
	jne	.L104
	movq	%rcx, %rax
	andq	$-4, %rax
	testb	$3, %cl
	je	.L106
.L103:
	leaq	1(%rax), %rdx
	movl	$1, (%rbx,%rax,4)
	cmpq	%rdx, %rcx
	jle	.L106
	addq	$2, %rax
	movl	$1, (%rbx,%rdx,4)
	cmpq	%rax, %rcx
	jle	.L106
	movl	$1, (%rbx,%rax,4)
.L106:
	cmpq	$0, m(%rip)
	jle	.L102
	xorl	%r14d, %r14d
	leaq	80(%rsp), %r13
	leaq	unicnt(%rip), %rbx
	leaq	72(%rsp), %r12
	leaq	.LC2(%rip), %rbp
	jmp	.L101
	.p2align 4,,10
	.p2align 3
.L108:
	movslq	%r11d, %r10
	movl	%r11d, %eax
	movl	(%rbx,%r10,4), %edx
	testl	%edx, %edx
	jle	.L149
.L116:
	cmpl	%ecx, %eax
	je	.L124
	movl	(%rbx,%r8,4), %eax
	testl	%eax, %eax
	jle	.L150
.L125:
	testl	%edx, %edx
	jle	.L151
.L132:
	cmpl	%r9d, %esi
	je	.L139
	movslq	%r9d, %rdx
	movslq	%esi, %rdi
	movl	(%rbx,%rdx,4), %ecx
	movl	(%rbx,%rdi,4), %eax
	cmpl	%eax, %ecx
	jl	.L140
	movl	%eax, %edx
	movl	%r9d, %esi
	movl	%ecx, %eax
	movl	%edx, %ecx
	movq	%rdi, %rdx
	movslq	%r9d, %rdi
.L140:
	addl	%ecx, %eax
	negl	%esi
	movl	%eax, (%rbx,%rdi,4)
	movl	%esi, (%rbx,%rdx,4)
.L139:
	subq	$1, %r15
.L124:
	addq	$1, %r14
	cmpq	%r14, m(%rip)
	jle	.L102
.L101:
	movq	%r12, %rsi
	movq	%r13, %rdx
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	80(%rsp), %rax
	leaq	-1(%rax), %r11
	movq	72(%rsp), %rax
	movl	%r11d, %esi
	leaq	-1(%rax), %rcx
	movslq	%ecx, %r8
	movl	%ecx, %r9d
	movl	(%rbx,%r8,4), %eax
	testl	%eax, %eax
	jg	.L108
	movl	%eax, %ecx
	negl	%ecx
	movslq	%ecx, %r10
	movl	(%rbx,%r10,4), %edx
	testl	%edx, %edx
	jle	.L152
.L109:
	movslq	%r11d, %r10
	movl	%eax, (%rbx,%r8,4)
	movl	%r11d, %eax
	movl	(%rbx,%r10,4), %edx
	testl	%edx, %edx
	jg	.L116
.L149:
	movl	%edx, %eax
	negl	%eax
	movslq	%eax, %r11
	movl	(%rbx,%r11,4), %edi
	testl	%edi, %edi
	jle	.L153
.L117:
	movl	%edx, (%rbx,%r10,4)
	jmp	.L116
	.p2align 4,,10
	.p2align 3
.L151:
	movl	%edx, %esi
	negl	%esi
	movslq	%esi, %rcx
	movl	(%rbx,%rcx,4), %eax
	testl	%eax, %eax
	jle	.L154
.L133:
	movl	%edx, (%rbx,%r10,4)
	jmp	.L132
	.p2align 4,,10
	.p2align 3
.L150:
	movl	%eax, %r9d
	negl	%r9d
	movslq	%r9d, %rcx
	movl	(%rbx,%rcx,4), %edx
	testl	%edx, %edx
	jle	.L155
.L126:
	movl	%eax, (%rbx,%r8,4)
	movl	(%rbx,%r10,4), %edx
	jmp	.L125
	.p2align 4,,10
	.p2align 3
.L102:
	xorl	%eax, %eax
	movq	%r15, %rdx
	movl	$1, %edi
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L156
	addq	$104, %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
.L153:
	.cfi_restore_state
	movl	%edi, %eax
	negl	%eax
	movslq	%eax, %rdx
	movl	(%rbx,%rdx,4), %edi
	testl	%edi, %edi
	jle	.L157
.L118:
	movl	%eax, %edx
	negl	%edx
	movl	%edx, (%rbx,%r11,4)
	jmp	.L117
.L152:
	negl	%edx
	movslq	%edx, %rcx
	movl	(%rbx,%rcx,4), %eax
	testl	%eax, %eax
	jle	.L158
.L110:
	movl	%edx, %eax
	movl	%edx, %ecx
	negl	%eax
	movl	%eax, (%rbx,%r10,4)
	jmp	.L109
.L155:
	negl	%edx
	movslq	%edx, %r11
	movl	(%rbx,%r11,4), %eax
	movq	%r11, %r9
	testl	%eax, %eax
	jle	.L159
.L127:
	movl	%r9d, %eax
	negl	%eax
	movl	%eax, (%rbx,%rcx,4)
	jmp	.L126
.L154:
	negl	%eax
	movslq	%eax, %r8
	movl	(%rbx,%r8,4), %eax
	movq	%r8, %rsi
	testl	%eax, %eax
	jle	.L160
.L134:
	movl	%esi, %edx
	negl	%edx
	movl	%edx, (%rbx,%rcx,4)
	jmp	.L133
.L158:
	negl	%eax
	movslq	%eax, %rdx
	movl	(%rbx,%rdx,4), %edi
	testl	%edi, %edi
	jle	.L161
.L111:
	movl	%eax, %edx
	negl	%edx
	movl	%edx, (%rbx,%rcx,4)
	movl	%eax, %edx
	jmp	.L110
.L157:
	negl	%edi
	movslq	%edi, %rax
	movq	%rax, 8(%rsp)
	movl	(%rbx,%rax,4), %eax
	testl	%eax, %eax
	jle	.L162
.L119:
	movl	%edi, %eax
	negl	%eax
	movl	%eax, (%rbx,%rdx,4)
	movl	%edi, %eax
	jmp	.L118
.L159:
	negl	%eax
	movslq	%eax, %r9
	movl	(%rbx,%r9,4), %edx
	testl	%edx, %edx
	jle	.L163
.L128:
	movl	%eax, %edx
	movl	%eax, %r9d
	negl	%edx
	movl	%edx, (%rbx,%r11,4)
	jmp	.L127
.L160:
	negl	%eax
	movslq	%eax, %rsi
	movl	(%rbx,%rsi,4), %edx
	testl	%edx, %edx
	jle	.L164
.L135:
	movl	%eax, %edx
	movl	%eax, %esi
	negl	%edx
	movl	%edx, (%rbx,%r8,4)
	jmp	.L134
.L143:
	xorl	%eax, %eax
	leaq	unicnt(%rip), %rbx
	jmp	.L103
.L164:
	movl	%edx, %eax
	negl	%eax
	movslq	%eax, %rdi
	movl	(%rbx,%rdi,4), %edx
	movq	%rdi, 8(%rsp)
	testl	%edx, %edx
	jle	.L165
.L136:
	movl	%eax, %edx
	negl	%edx
	movl	%edx, (%rbx,%rsi,4)
	jmp	.L135
.L163:
	movl	%edx, %eax
	negl	%eax
	movslq	%eax, %rdi
	movl	(%rbx,%rdi,4), %edx
	movq	%rdi, 8(%rsp)
	testl	%edx, %edx
	jle	.L166
.L129:
	movl	%eax, %edx
	negl	%edx
	movl	%edx, (%rbx,%r9,4)
	jmp	.L128
.L161:
	negl	%edi
	movslq	%edi, %rax
	movq	%rax, 16(%rsp)
	movl	(%rbx,%rax,4), %eax
	testl	%eax, %eax
	jle	.L167
.L112:
	movl	%edi, %eax
	negl	%eax
	movl	%eax, (%rbx,%rdx,4)
	movl	%edi, %eax
	jmp	.L111
.L162:
	negl	%eax
	movslq	%eax, %rdi
	movl	%eax, 16(%rsp)
	movq	%rdi, 24(%rsp)
	movl	(%rbx,%rdi,4), %edi
	testl	%edi, %edi
	jle	.L168
.L120:
	movl	16(%rsp), %edi
	movq	8(%rsp), %rax
	negl	%edi
	movl	%edi, (%rbx,%rax,4)
	movl	16(%rsp), %edi
	jmp	.L119
.L167:
	negl	%eax
	movslq	%eax, %rdi
	movl	%eax, 8(%rsp)
	movq	%rdi, 32(%rsp)
	movl	(%rbx,%rdi,4), %edi
	testl	%edi, %edi
	jle	.L169
.L113:
	movl	8(%rsp), %edi
	movq	16(%rsp), %rax
	negl	%edi
	movl	%edi, (%rbx,%rax,4)
	movl	8(%rsp), %edi
	jmp	.L112
.L168:
	movl	%edi, %eax
	negl	%eax
	movl	%eax, 16(%rsp)
	cltq
	movq	%rax, 40(%rsp)
	movl	(%rbx,%rax,4), %eax
	testl	%eax, %eax
	jle	.L170
.L121:
	movl	16(%rsp), %eax
	movq	24(%rsp), %rdi
	negl	%eax
	movl	%eax, (%rbx,%rdi,4)
	jmp	.L120
.L166:
	negl	%edx
	movslq	%edx, %rax
	movq	%rax, 16(%rsp)
	movl	(%rbx,%rax,4), %eax
	testl	%eax, %eax
	jle	.L171
.L130:
	movq	8(%rsp), %rdi
	movl	%edx, %eax
	negl	%eax
	movl	%eax, (%rbx,%rdi,4)
	movl	%edx, %eax
	jmp	.L129
.L165:
	movl	%edx, %eax
	negl	%eax
	movslq	%eax, %r11
	movl	(%rbx,%r11,4), %edx
	testl	%edx, %edx
	jle	.L172
.L137:
	movq	8(%rsp), %rdi
	movl	%eax, %edx
	negl	%edx
	movl	%edx, (%rbx,%rdi,4)
	jmp	.L136
.L170:
	negl	%eax
	movl	%eax, 16(%rsp)
	cltq
	movq	%rax, 48(%rsp)
	movl	(%rbx,%rax,4), %eax
	testl	%eax, %eax
	jle	.L173
.L122:
	movl	16(%rsp), %eax
	movq	40(%rsp), %rdi
	negl	%eax
	movl	%eax, (%rbx,%rdi,4)
	jmp	.L121
.L169:
	movl	%edi, %eax
	negl	%eax
	movl	%eax, 8(%rsp)
	cltq
	movq	%rax, 40(%rsp)
	movl	(%rbx,%rax,4), %eax
	testl	%eax, %eax
	jle	.L174
.L114:
	movl	8(%rsp), %eax
	movq	32(%rsp), %rdi
	negl	%eax
	movl	%eax, (%rbx,%rdi,4)
	jmp	.L113
.L172:
	movl	%edx, %eax
	negl	%eax
	movslq	%eax, %rdx
	movl	(%rbx,%rdx,4), %edi
	testl	%edi, %edi
	jle	.L175
.L138:
	movl	%eax, %edx
	negl	%edx
	movl	%edx, (%rbx,%r11,4)
	jmp	.L137
.L171:
	negl	%eax
	movslq	%eax, %rdx
	movl	(%rbx,%rdx,4), %edi
	testl	%edi, %edi
	jle	.L176
.L131:
	movq	16(%rsp), %rdi
	movl	%eax, %edx
	negl	%edx
	movl	%edx, (%rbx,%rdi,4)
	movl	%eax, %edx
	jmp	.L130
.L174:
	negl	%eax
	movslq	%eax, %rdi
	movl	%eax, 8(%rsp)
	movq	%rdi, 24(%rsp)
	movl	(%rbx,%rdi,4), %edi
	testl	%edi, %edi
	jle	.L177
.L115:
	movl	8(%rsp), %edi
	movq	40(%rsp), %rax
	negl	%edi
	movl	%edi, (%rbx,%rax,4)
	jmp	.L114
.L173:
	negl	%eax
	movslq	%eax, %rdi
	movl	%eax, 16(%rsp)
	movq	%rdi, 32(%rsp)
	movl	(%rbx,%rdi,4), %edi
	testl	%edi, %edi
	jle	.L178
.L123:
	movl	16(%rsp), %edi
	movq	48(%rsp), %rax
	negl	%edi
	movl	%edi, (%rbx,%rax,4)
	jmp	.L122
.L156:
	call	__stack_chk_fail@PLT
.L175:
	negl	%edi
	movq	%rdx, 16(%rsp)
	call	root
	movq	16(%rsp), %rdx
	movl	%eax, %edi
	negl	%edi
	movl	%edi, (%rbx,%rdx,4)
	jmp	.L138
.L177:
	negl	%edi
	movq	%rdx, 48(%rsp)
	call	root
	movq	24(%rsp), %rdx
	movl	%eax, %edi
	movl	%eax, 8(%rsp)
	negl	%edi
	movl	%edi, (%rbx,%rdx,4)
	movq	48(%rsp), %rdx
	jmp	.L115
.L176:
	negl	%edi
	movq	%rdx, 24(%rsp)
	call	root
	movq	24(%rsp), %rdx
	movl	%eax, %edi
	negl	%edi
	movl	%edi, (%rbx,%rdx,4)
	jmp	.L131
.L178:
	negl	%edi
	movq	%rdx, 56(%rsp)
	call	root
	movq	32(%rsp), %rdx
	movl	%eax, %edi
	movl	%eax, 16(%rsp)
	negl	%edi
	movl	%edi, (%rbx,%rdx,4)
	movq	56(%rsp), %rdx
	jmp	.L123
	.cfi_endproc
.LFE60:
	.size	main, .-main
	.globl	m
	.bss
	.align 8
	.type	m, @object
	.size	m, 8
m:
	.zero	8
	.globl	n
	.align 8
	.type	n, @object
	.size	n, 8
n:
	.zero	8
	.globl	unicnt
	.align 32
	.type	unicnt, @object
	.size	unicnt, 524328
unicnt:
	.zero	524328
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1
	.long	1
	.long	1
	.long	1
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define INF ((1LL<<62)-(1LL<<31))
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define bit(n,m)(((n)>>(m))&1)
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
ll pom(ll a,ll n,int m){ll x=1;for(a%=m;n;n/=2)n&1?x=x*a%m:0,a=a*a%m;return x;}
//#define MOD 998244353
#define MOD 1000000007
#define invp(a,p)pom(a,p-2,p)


//union-find
#define UFLIMIT (1<<17)
int unicnt[UFLIMIT+10];//正ならcnt、非正なら根のindex
void ufinit(int n){rep(i,0,n)unicnt[i]=1;}
int root(int x){return unicnt[x]<=0?-(unicnt[x]=-root(-unicnt[x])):x;}
int same(int x,int y){return root(x)==root(y);}
void uni(int x,int y){if((x=root(x))==(y=root(y)))return;if(unicnt[x]<unicnt[y]){int t=x;x=y;y=t;}unicnt[x]+=unicnt[y];unicnt[y]=-x;}
#undef UFLIMIT

ll n,m;
int main(){
	scanf("%lld%lld",&n,&m);
	ll ans=n;
	ufinit(n);
	rep(i,0,m){
		ll x,y;
		scanf("%lld%lld%*lld",&x,&y);
		x--,y--;
		if(!same(x,y)){
			uni(x,y);
			ans--;
		}
	}
	printf("%lld",ans);
}
3 1
2 2 1
 3 1
3 2 1
 6 1
3 2 1
 4 1
2 2 1
 10 1
3 2 1
 8 1
1 2 1
 12 1
3 2 -1
 6 1
1 1 1
 13 1
3 2 -1
 10 1
2 2 1

3 2 5 4 9 7 11 6 12 10
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>
#include <string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define INF ((1LL<<62)-(1LL<<31))
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define bit(n,m)(((n)>>(m))&1)
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
ll pom(ll a,ll n,int m){ll x=1;for(a%=m;n;n/=2)n&1?x=x*a%m:0,a=a*a%m;return x;}
//#define MOD 998244353
#define MOD 1000000007
#define invp(a,p)pom(a,p-2,p)


//union-find
#define UFLIMIT (1<<17)
int unicnt[UFLIMIT+10];//正ならcnt、非正なら根のindex
void ufinit(int n){rep(i,0,n)unicnt[i]=1;}
int root(int x){return unicnt[x]<=0?-(unicnt[x]=-root(-unicnt[x])):x;}
int same(int x,int y){return root(x)==root(y);}
void uni(int x,int y){if((x=root(x))==(y=root(y)))return;if(unicnt[x]<unicnt[y]){int t=x;x=y;y=t;}unicnt[x]+=unicnt[y];unicnt[y]=-x;}
#undef UFLIMIT

ll n,m;
int main(){
	scanf("%lld%lld",&n,&m);
	ll ans=n;
	ufinit(n);
	rep(i,0,m){
		ll x,y;
		scanf("%lld%lld%*lld",&x,&y);
		x--,y--;
		if(!same(x,y)){
			uni(x,y);
			ans--;
		}
	}
	printf("%lld",ans);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	upll
	.type	upll, @function
upll:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jl	.L2
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	setg	%al
	movzbl	%al, %eax
	jmp	.L4
.L2:
	movl	$-1, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	upll, .-upll
	.globl	downll
	.type	downll, @function
downll:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jl	.L6
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jle	.L7
	movl	$-1, %eax
	jmp	.L10
.L7:
	movl	$0, %eax
	jmp	.L10
.L6:
	movl	$1, %eax
.L10:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	downll, .-downll
	.globl	sortup
	.type	sortup, @function
sortup:
.LFB8:
	.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
	movq	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rsi
	movq	-8(%rbp), %rax
	leaq	upll(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	sortup, .-sortup
	.globl	sortdown
	.type	sortdown, @function
sortdown:
.LFB9:
	.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
	movq	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rsi
	movq	-8(%rbp), %rax
	leaq	downll(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	sortdown, .-sortdown
	.globl	pom
	.type	pom, @function
pom:
.LFB10:
	.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)
	movl	%edx, -36(%rbp)
	movq	$1, -8(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rcx
	movq	-24(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, -24(%rbp)
	jmp	.L14
.L17:
	movq	-32(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L16
	movq	-8(%rbp), %rax
	imulq	-24(%rbp), %rax
	movl	-36(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, -8(%rbp)
.L16:
	movq	-24(%rbp), %rax
	imulq	%rax, %rax
	movl	-36(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, -24(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -32(%rbp)
.L14:
	cmpq	$0, -32(%rbp)
	jne	.L17
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	pom, .-pom
	.globl	unicnt
	.bss
	.align 32
	.type	unicnt, @object
	.size	unicnt, 524328
unicnt:
	.zero	524328
	.text
	.globl	ufinit
	.type	ufinit, @function
ufinit:
.LFB11:
	.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)
	movq	$0, -8(%rbp)
	jmp	.L20
.L21:
	movq	-8(%rbp), %rax
	leaq	0(,%rax,4), %rdx
	leaq	unicnt(%rip), %rax
	movl	$1, (%rdx,%rax)
	addq	$1, -8(%rbp)
.L20:
	movl	-20(%rbp), %eax
	cltq
	cmpq	%rax, -8(%rbp)
	jl	.L21
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	ufinit, .-ufinit
	.globl	root
	.type	root, @function
root:
.LFB12:
	.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	unicnt(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jg	.L23
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	unicnt(%rip), %rax
	movl	(%rdx,%rax), %eax
	negl	%eax
	movl	%eax, %edi
	call	root
	negl	%eax
	movl	%eax, %ecx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	unicnt(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	unicnt(%rip), %rax
	movl	(%rdx,%rax), %eax
	negl	%eax
	jmp	.L25
.L23:
	movl	-4(%rbp), %eax
.L25:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	root, .-root
	.globl	same
	.type	same, @function
same:
.LFB13:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 3, -24
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	root
	movl	%eax, %ebx
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	call	root
	cmpl	%eax, %ebx
	sete	%al
	movzbl	%al, %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	same, .-same
	.globl	uni
	.type	uni, @function
uni:
.LFB14:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	root
	movl	%eax, -20(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	call	root
	movl	%eax, -24(%rbp)
	movl	-20(%rbp), %eax
	cmpl	-24(%rbp), %eax
	je	.L32
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	unicnt(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	unicnt(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L31
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -24(%rbp)
.L31:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	unicnt(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	unicnt(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	unicnt(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-20(%rbp), %eax
	negl	%eax
	movl	%eax, %ecx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	unicnt(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L28
.L32:
	nop
.L28:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	uni, .-uni
	.globl	n
	.bss
	.align 8
	.type	n, @object
	.size	n, 8
n:
	.zero	8
	.globl	m
	.align 8
	.type	m, @object
	.size	m, 8
m:
	.zero	8
	.section	.rodata
.LC0:
	.string	"%lld%lld"
.LC1:
	.string	"%lld%lld%*lld"
.LC2:
	.string	"%lld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB15:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	m(%rip), %rax
	movq	%rax, %rdx
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	n(%rip), %rax
	movq	%rax, -24(%rbp)
	movq	n(%rip), %rax
	movl	%eax, %edi
	call	ufinit
	movq	$0, -16(%rbp)
	jmp	.L34
.L36:
	leaq	-32(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-40(%rbp), %rax
	subq	$1, %rax
	movq	%rax, -40(%rbp)
	movq	-32(%rbp), %rax
	subq	$1, %rax
	movq	%rax, -32(%rbp)
	movq	-32(%rbp), %rax
	movl	%eax, %edx
	movq	-40(%rbp), %rax
	movl	%edx, %esi
	movl	%eax, %edi
	call	same
	testl	%eax, %eax
	jne	.L35
	movq	-32(%rbp), %rax
	movl	%eax, %edx
	movq	-40(%rbp), %rax
	movl	%edx, %esi
	movl	%eax, %edi
	call	uni
	subq	$1, -24(%rbp)
.L35:
	addq	$1, -16(%rbp)
.L34:
	movq	m(%rip), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L36
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L38
	call	__stack_chk_fail@PLT
.L38:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.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	upll
	.type	upll, @function
upll:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jl	.L2
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	setg	%al
	movzbl	%al, %eax
	jmp	.L4
.L2:
	movl	$-1, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	upll, .-upll
	.globl	downll
	.type	downll, @function
downll:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jl	.L6
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jle	.L7
	movl	$-1, %eax
	jmp	.L10
.L7:
	movl	$0, %eax
	jmp	.L10
.L6:
	movl	$1, %eax
.L10:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	downll, .-downll
	.globl	sortup
	.type	sortup, @function
sortup:
.LFB8:
	.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
	movq	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rsi
	movq	-8(%rbp), %rax
	leaq	upll(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	sortup, .-sortup
	.globl	sortdown
	.type	sortdown, @function
sortdown:
.LFB9:
	.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
	movq	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rsi
	movq	-8(%rbp), %rax
	leaq	downll(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	sortdown, .-sortdown
	.globl	pom
	.type	pom, @function
pom:
.LFB10:
	.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)
	movl	%edx, -36(%rbp)
	movq	$1, -8(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rcx
	movq	-24(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, -24(%rbp)
	jmp	.L14
.L17:
	movq	-32(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L16
	movq	-8(%rbp), %rax
	imulq	-24(%rbp), %rax
	movl	-36(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, -8(%rbp)
.L16:
	movq	-24(%rbp), %rax
	imulq	%rax, %rax
	movl	-36(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, -24(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -32(%rbp)
.L14:
	cmpq	$0, -32(%rbp)
	jne	.L17
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	pom, .-pom
	.globl	unicnt
	.bss
	.align 32
	.type	unicnt, @object
	.size	unicnt, 524328
unicnt:
	.zero	524328
	.text
	.globl	ufinit
	.type	ufinit, @function
ufinit:
.LFB11:
	.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)
	movq	$0, -8(%rbp)
	jmp	.L20
.L21:
	movq	-8(%rbp), %rax
	leaq	0(,%rax,4), %rdx
	leaq	unicnt(%rip), %rax
	movl	$1, (%rdx,%rax)
	addq	$1, -8(%rbp)
.L20:
	movl	-20(%rbp), %eax
	cltq
	cmpq	%rax, -8(%rbp)
	jl	.L21
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	ufinit, .-ufinit
	.globl	root
	.type	root, @function
root:
.LFB12:
	.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	unicnt(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jg	.L23
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	unicnt(%rip), %rax
	movl	(%rdx,%rax), %eax
	negl	%eax
	movl	%eax, %edi
	call	root
	negl	%eax
	movl	%eax, %ecx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	unicnt(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	unicnt(%rip), %rax
	movl	(%rdx,%rax), %eax
	negl	%eax
	jmp	.L25
.L23:
	movl	-4(%rbp), %eax
.L25:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	root, .-root
	.globl	same
	.type	same, @function
same:
.LFB13:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 3, -24
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	root
	movl	%eax, %ebx
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	call	root
	cmpl	%eax, %ebx
	sete	%al
	movzbl	%al, %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	same, .-same
	.globl	uni
	.type	uni, @function
uni:
.LFB14:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	root
	movl	%eax, -20(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	call	root
	movl	%eax, -24(%rbp)
	movl	-20(%rbp), %eax
	cmpl	-24(%rbp), %eax
	je	.L32
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	unicnt(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	unicnt(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L31
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -24(%rbp)
.L31:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	unicnt(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	unicnt(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	unicnt(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-20(%rbp), %eax
	negl	%eax
	movl	%eax, %ecx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	unicnt(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L28
.L32:
	nop
.L28:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	uni, .-uni
	.globl	n
	.bss
	.align 8
	.type	n, @object
	.size	n, 8
n:
	.zero	8
	.globl	m
	.align 8
	.type	m, @object
	.size	m, 8
m:
	.zero	8
	.section	.rodata
.LC0:
	.string	"%lld%lld"
.LC1:
	.string	"%lld%lld%*lld"
.LC2:
	.string	"%lld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB15:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	m(%rip), %rax
	movq	%rax, %rdx
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	n(%rip), %rax
	movq	%rax, -24(%rbp)
	movq	n(%rip), %rax
	movl	%eax, %edi
	call	ufinit
	movq	$0, -16(%rbp)
	jmp	.L34
.L36:
	leaq	-32(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-40(%rbp), %rax
	subq	$1, %rax
	movq	%rax, -40(%rbp)
	movq	-32(%rbp), %rax
	subq	$1, %rax
	movq	%rax, -32(%rbp)
	movq	-32(%rbp), %rax
	movl	%eax, %edx
	movq	-40(%rbp), %rax
	movl	%edx, %esi
	movl	%eax, %edi
	call	same
	testl	%eax, %eax
	jne	.L35
	movq	-32(%rbp), %rax
	movl	%eax, %edx
	movq	-40(%rbp), %rax
	movl	%edx, %esi
	movl	%eax, %edi
	call	uni
	subq	$1, -24(%rbp)
.L35:
	addq	$1, -16(%rbp)
.L34:
	movq	m(%rip), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L36
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L38
	call	__stack_chk_fail@PLT
.L38:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.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:
