Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
#define MAXN 101000
int N, M;
int f[MAXN], dis[MAXN];
void init()
{
	for (int i = 0; i <= N; i++)
	{
		f[i] = i;
	}
}
int find(int x)
{
	if (f[x] == x)
		return x;
	else
	{
		int r = find(f[x]);
		dis[x] = dis[f[x]] + dis[x];
		return f[x] = r;
	}
}
int find_father(int x,int y,int z)
{
	int fx = find(x);
	int fy = find(y);
	if (fx == fy)
	{
		return z == dis[y] - dis[x];
	}
	f[fy] = fx;
	dis[fy] = dis[x] + z - dis[y];
	return 1;
}
int main()
{
	int a = 1;
	scanf("%d %d", &N, &M);
	init();
	for (int i = 1; i <= M; i++)
	{
		int x, y, z;
		scanf("%d %d %d", &x, &y, &z);
		if (a)
			a = find_father(x, y, z);
	}
	if (a)
		printf("Yes\n");
	else
		printf("No\n");
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	f
	.align 32
	.type	f, @object
	.size	f, 404000
f:
	.zero	404000
	.globl	dis
	.align 32
	.type	dis, @object
	.size	dis, 404000
dis:
	.zero	404000
	.text
	.globl	init
	.type	init, @function
init:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -4(%rbp)
	jmp	.L2
.L3:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	f(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	addl	$1, -4(%rbp)
.L2:
	movl	N(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L3
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	init, .-init
	.globl	find
	.type	find, @function
find:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	f(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -20(%rbp)
	jne	.L5
	movl	-20(%rbp), %eax
	jmp	.L6
.L5:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	f(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %edi
	call	find
	movl	%eax, -4(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	f(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dis(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dis(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dis(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	f(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	f(%rip), %rax
	movl	(%rdx,%rax), %eax
.L6:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	find, .-find
	.globl	find_father
	.type	find_father, @function
find_father:
.LFB2:
	.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	%edx, -28(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	find
	movl	%eax, -8(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	call	find
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jne	.L8
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dis(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	dis(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	cmpl	%eax, -28(%rbp)
	sete	%al
	movzbl	%al, %eax
	jmp	.L9
.L8:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	f(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dis(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-28(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dis(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	%eax, %ecx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dis(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	$1, %eax
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	find_father, .-find_father
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d %d %d"
.LC2:
	.string	"Yes"
.LC3:
	.string	"No"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1, -16(%rbp)
	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
	movl	$0, %eax
	call	init
	movl	$1, -12(%rbp)
	jmp	.L11
.L13:
	leaq	-20(%rbp), %rcx
	leaq	-24(%rbp), %rdx
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$0, -16(%rbp)
	je	.L12
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %ecx
	movl	-28(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	find_father
	movl	%eax, -16(%rbp)
.L12:
	addl	$1, -12(%rbp)
.L11:
	movl	M(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L13
	cmpl	$0, -16(%rbp)
	je	.L14
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L15
.L14:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L15:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	init
	.type	init, @function
init:
.LFB23:
	.cfi_startproc
	endbr64
	movl	N(%rip), %ecx
	testl	%ecx, %ecx
	js	.L1
	leal	1(%rcx), %edi
	cmpl	$2, %ecx
	jle	.L6
	movl	%edi, %edx
	leaq	f(%rip), %rsi
	movdqa	.LC0(%rip), %xmm0
	movdqa	.LC1(%rip), %xmm2
	shrl	$2, %edx
	leaq	16(%rsi), %r8
	movq	%rsi, %rax
	subl	$1, %edx
	salq	$4, %rdx
	addq	%r8, %rdx
	.p2align 4,,10
	.p2align 3
.L4:
	movdqa	%xmm0, %xmm1
	addq	$16, %rax
	paddd	%xmm2, %xmm0
	movaps	%xmm1, -16(%rax)
	cmpq	%rdx, %rax
	jne	.L4
	movl	%edi, %eax
	andl	$-4, %eax
	andl	$3, %edi
	je	.L9
.L3:
	movslq	%eax, %rdx
	movl	%eax, (%rsi,%rdx,4)
	leal	1(%rax), %edx
	cmpl	%edx, %ecx
	jl	.L1
	movslq	%edx, %rdi
	addl	$2, %eax
	movl	%edx, (%rsi,%rdi,4)
	cmpl	%eax, %ecx
	jl	.L1
	movslq	%eax, %rdx
	movl	%eax, (%rsi,%rdx,4)
.L1:
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	ret
.L6:
	xorl	%eax, %eax
	leaq	f(%rip), %rsi
	jmp	.L3
	.cfi_endproc
.LFE23:
	.size	init, .-init
	.p2align 4
	.globl	find
	.type	find, @function
find:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movslq	%edi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	f(%rip), %rbx
	movq	%rbp, %rax
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	movl	(%rbx,%rbp,4), %edx
	cmpl	%ebp, %edx
	jne	.L21
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L21:
	.cfi_restore_state
	movslq	%edx, %r13
	leaq	dis(%rip), %r12
	movl	(%rbx,%r13,4), %eax
	movslq	%eax, %rcx
	cmpl	%eax, %edx
	je	.L12
	movslq	%eax, %r14
	movslq	(%rbx,%r14,4), %rdx
	cmpl	%edx, %eax
	jne	.L22
.L13:
	movl	(%r12,%rdx,4), %edx
	addl	%edx, (%r12,%r13,4)
	movl	%eax, (%rbx,%r13,4)
	movslq	(%rbx,%rbp,4), %rcx
.L12:
	movl	%eax, (%rbx,%rbp,4)
	movl	(%r12,%rcx,4), %edx
	addl	%edx, (%r12,%rbp,4)
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L22:
	.cfi_restore_state
	movslq	%edx, %r15
	movslq	(%rbx,%r15,4), %rdi
	movl	%edi, %eax
	cmpl	%edi, %edx
	je	.L14
	call	find
	movslq	(%rbx,%r15,4), %rdx
	movl	%eax, (%rbx,%r15,4)
	movslq	(%rbx,%r14,4), %rdi
	movl	(%r12,%rdx,4), %edx
	addl	%edx, (%r12,%r15,4)
.L14:
	movl	(%r12,%rdi,4), %edx
	movl	%eax, (%rbx,%r14,4)
	addl	%edx, (%r12,%r14,4)
	movslq	(%rbx,%r13,4), %rdx
	jmp	.L13
	.cfi_endproc
.LFE24:
	.size	find, .-find
	.p2align 4
	.globl	find_father
	.type	find_father, @function
find_father:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	f(%rip), %r8
	movl	%esi, %r11d
	movl	%edx, %r9d
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	dis(%rip), %rsi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movslq	%edi, %rbx
	movl	(%r8,%rbx,4), %r10d
	cmpl	%r10d, %edi
	jne	.L42
	movslq	%r11d, %rbp
	movslq	(%r8,%rbp,4), %rdx
	cmpl	%edx, %r11d
	jne	.L28
.L45:
	movl	(%rsi,%rbp,4), %ecx
	movl	(%rsi,%rbx,4), %eax
	cmpl	%r10d, %edx
	je	.L43
.L32:
	addl	%eax, %r9d
	movl	%r10d, (%r8,%rdx,4)
	movl	$1, %eax
	subl	%ecx, %r9d
	movl	%r9d, (%rsi,%rdx,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
.L42:
	.cfi_restore_state
	movslq	%r10d, %rbp
	movl	(%r8,%rbp,4), %eax
	movslq	%eax, %rdx
	cmpl	%eax, %r10d
	je	.L25
	movslq	%eax, %r10
	movslq	(%r8,%r10,4), %rdx
	cmpl	%edx, %eax
	jne	.L44
.L26:
	movl	(%rsi,%rdx,4), %edx
	movl	%eax, (%r8,%rbp,4)
	addl	%edx, (%rsi,%rbp,4)
	movslq	(%r8,%rbx,4), %rdx
.L25:
	movslq	%r11d, %rbp
	movl	(%rsi,%rdx,4), %edx
	movl	%eax, (%r8,%rbx,4)
	movl	%eax, %r10d
	addl	%edx, (%rsi,%rbx,4)
	movslq	(%r8,%rbp,4), %rdx
	cmpl	%edx, %r11d
	je	.L45
.L28:
	movslq	%edx, %r11
	movl	(%r8,%r11,4), %eax
	movl	%eax, %ecx
	cmpl	%eax, %edx
	je	.L30
	movslq	%eax, %r12
	movslq	(%r8,%r12,4), %rdi
	cmpl	%edi, %eax
	jne	.L46
.L31:
	movl	(%rsi,%rdi,4), %edx
	addl	%edx, (%rsi,%r11,4)
	movl	%eax, (%r8,%r11,4)
	movl	(%r8,%rbp,4), %ecx
.L30:
	movslq	%ecx, %rdx
	movl	(%rsi,%rbp,4), %ecx
	movl	%eax, (%r8,%rbp,4)
	addl	(%rsi,%rdx,4), %ecx
	movslq	%eax, %rdx
	movl	%ecx, (%rsi,%rbp,4)
	movl	(%rsi,%rbx,4), %eax
	cmpl	%r10d, %edx
	jne	.L32
.L43:
	subl	%eax, %ecx
	xorl	%eax, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	cmpl	%r9d, %ecx
	popq	%r12
	.cfi_def_cfa_offset 8
	sete	%al
	ret
	.p2align 4,,10
	.p2align 3
.L46:
	.cfi_restore_state
	call	find
	movslq	(%r8,%r12,4), %rdx
	movl	%eax, (%r8,%r12,4)
	movslq	(%r8,%r11,4), %rdi
	movl	(%rsi,%rdx,4), %edx
	addl	%edx, (%rsi,%r12,4)
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L44:
	movslq	%edx, %r12
	movslq	(%r8,%r12,4), %rdi
	movl	%edi, %eax
	cmpl	%edi, %edx
	je	.L27
	call	find
	movslq	(%r8,%r12,4), %rdx
	movl	%eax, (%r8,%r12,4)
	movslq	(%r8,%r10,4), %rdi
	movl	(%rsi,%rdx,4), %edx
	addl	%edx, (%rsi,%r12,4)
.L27:
	movl	(%rsi,%rdi,4), %edx
	movl	%eax, (%r8,%r10,4)
	addl	%edx, (%rsi,%r10,4)
	movslq	(%r8,%rbp,4), %rdx
	jmp	.L26
	.cfi_endproc
.LFE25:
	.size	find_father, .-find_father
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"%d %d"
.LC3:
	.string	"Yes"
.LC4:
	.string	"%d %d %d"
.LC5:
	.string	"No"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB26:
	.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	.LC2(%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	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	N(%rip), %ecx
	testl	%ecx, %ecx
	js	.L54
	leal	1(%rcx), %edi
	cmpl	$2, %ecx
	jle	.L70
	movl	%edi, %edx
	leaq	f(%rip), %rsi
	movdqa	.LC0(%rip), %xmm0
	movdqa	.LC1(%rip), %xmm2
	shrl	$2, %edx
	leaq	16(%rsi), %r8
	movq	%rsi, %rax
	subl	$1, %edx
	salq	$4, %rdx
	addq	%r8, %rdx
	.p2align 4,,10
	.p2align 3
.L52:
	movdqa	%xmm0, %xmm1
	addq	$16, %rax
	paddd	%xmm2, %xmm0
	movaps	%xmm1, -16(%rax)
	cmpq	%rax, %rdx
	jne	.L52
	movl	%edi, %eax
	andl	$-4, %eax
	andl	$3, %edi
	je	.L54
.L51:
	movslq	%eax, %rdx
	movl	%eax, (%rsi,%rdx,4)
	leal	1(%rax), %edx
	cmpl	%edx, %ecx
	jl	.L54
	movslq	%edx, %rdi
	addl	$2, %eax
	movl	%edx, (%rsi,%rdi,4)
	cmpl	%ecx, %eax
	jg	.L54
	movslq	%eax, %rdx
	movl	%eax, (%rsi,%rdx,4)
.L54:
	movl	M(%rip), %ecx
	testl	%ecx, %ecx
	jle	.L50
	movl	$1, %ebx
	leaq	52(%rsp), %r15
	leaq	48(%rsp), %r14
	movl	$1, 12(%rsp)
	leaq	44(%rsp), %r13
	leaq	f(%rip), %r12
	leaq	dis(%rip), %rbp
	jmp	.L49
	.p2align 4,,10
	.p2align 3
.L57:
	addl	$1, %ebx
	cmpl	%ebx, M(%rip)
	jl	.L82
.L49:
	movq	%r14, %rdx
	movq	%r15, %rcx
	movq	%r13, %rsi
	xorl	%eax, %eax
	leaq	.LC4(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	testl	%edx, %edx
	je	.L57
	movslq	44(%rsp), %r10
	movl	52(%rsp), %r9d
	movl	48(%rsp), %r8d
	movl	(%r12,%r10,4), %esi
	cmpl	%esi, %r10d
	je	.L58
	movslq	%esi, %r11
	movl	(%r12,%r11,4), %eax
	movslq	%eax, %rcx
	cmpl	%eax, %esi
	je	.L59
	movslq	%eax, %rsi
	movl	(%r12,%rsi,4), %edi
	cmpl	%edi, %eax
	jne	.L83
.L60:
	movslq	(%r12,%r11,4), %rax
	movl	%edi, (%r12,%r11,4)
	movslq	(%r12,%r10,4), %rcx
	movl	0(%rbp,%rax,4), %eax
	addl	%eax, 0(%rbp,%r11,4)
	movl	%edi, %eax
.L59:
	movl	0(%rbp,%rcx,4), %ecx
	addl	%ecx, 0(%rbp,%r10,4)
	movl	%eax, %esi
	movl	%eax, (%r12,%r10,4)
.L58:
	movslq	%r8d, %r11
	movslq	(%r12,%r11,4), %rdi
	cmpl	%edi, %r8d
	jne	.L62
	movl	0(%rbp,%r11,4), %edx
	movl	0(%rbp,%r10,4), %eax
	cmpl	%esi, %edi
	je	.L84
.L67:
	addl	%eax, %r9d
	addl	$1, %ebx
	movl	%esi, (%r12,%rdi,4)
	subl	%edx, %r9d
	cmpl	%ebx, M(%rip)
	movl	%r9d, 0(%rbp,%rdi,4)
	jge	.L49
.L82:
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jne	.L50
	leaq	.LC5(%rip), %rdi
	call	puts@PLT
.L56:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L85
	addq	$72, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L62:
	.cfi_restore_state
	movslq	%edi, %r8
	movl	(%r12,%r8,4), %eax
	movslq	%eax, %rcx
	cmpl	%eax, %edi
	je	.L64
	movslq	%eax, %rcx
	movl	(%r12,%rcx,4), %edi
	cmpl	%edi, %eax
	jne	.L86
.L65:
	movslq	(%r12,%r8,4), %rax
	movl	%edi, (%r12,%r8,4)
	movslq	(%r12,%r11,4), %rcx
	movl	0(%rbp,%rax,4), %eax
	addl	%eax, 0(%rbp,%r8,4)
	movl	%edi, %eax
.L64:
	movl	0(%rbp,%r11,4), %edx
	movslq	%eax, %rdi
	addl	0(%rbp,%rcx,4), %edx
	movl	%eax, (%r12,%r11,4)
	movl	%edx, 0(%rbp,%r11,4)
	movl	0(%rbp,%r10,4), %eax
	cmpl	%esi, %edi
	jne	.L67
.L84:
	subl	%eax, %edx
	xorl	%eax, %eax
	cmpl	%r9d, %edx
	sete	%al
	movl	%eax, 12(%rsp)
	jmp	.L57
.L50:
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
	jmp	.L56
.L86:
	movslq	%edi, %rdx
	movl	(%r12,%rdx,4), %eax
	movq	%rdx, 16(%rsp)
	cmpl	%eax, %edi
	jne	.L87
.L66:
	movslq	(%r12,%rcx,4), %rdi
	movl	%eax, (%r12,%rcx,4)
	movl	0(%rbp,%rdi,4), %edi
	addl	%edi, 0(%rbp,%rcx,4)
	movl	%eax, %edi
	jmp	.L65
.L83:
	movslq	%edi, %rcx
	movl	(%r12,%rcx,4), %eax
	movq	%rcx, 16(%rsp)
	cmpl	%eax, %edi
	jne	.L88
.L61:
	movslq	(%r12,%rsi,4), %rcx
	movl	%eax, %edi
	movl	%eax, (%r12,%rsi,4)
	movl	0(%rbp,%rcx,4), %ecx
	addl	%ecx, 0(%rbp,%rsi,4)
	jmp	.L60
.L88:
	movl	%eax, %edi
	call	find
	movq	16(%rsp), %rcx
	movslq	(%r12,%rcx,4), %rdi
	movl	%eax, (%r12,%rcx,4)
	movl	0(%rbp,%rdi,4), %edi
	addl	%edi, 0(%rbp,%rcx,4)
	jmp	.L61
.L87:
	movl	%eax, %edi
	movq	%rcx, 24(%rsp)
	call	find
	movq	16(%rsp), %rdx
	movq	24(%rsp), %rcx
	movslq	(%r12,%rdx,4), %rdi
	movl	%eax, (%r12,%rdx,4)
	movl	0(%rbp,%rdi,4), %edi
	addl	%edi, 0(%rbp,%rdx,4)
	jmp	.L66
.L70:
	xorl	%eax, %eax
	leaq	f(%rip), %rsi
	jmp	.L51
.L85:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE26:
	.size	main, .-main
	.globl	dis
	.bss
	.align 32
	.type	dis, @object
	.size	dis, 404000
dis:
	.zero	404000
	.globl	f
	.align 32
	.type	f, @object
	.size	f, 404000
f:
	.zero	404000
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC1:
	.long	4
	.long	4
	.long	4
	.long	4
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	init
	.type	init, @function
init:
.LFB23:
	.cfi_startproc
	endbr64
	movl	N(%rip), %ecx
	testl	%ecx, %ecx
	js	.L1
	leal	1(%rcx), %edi
	cmpl	$2, %ecx
	jle	.L6
	movl	%edi, %edx
	leaq	f(%rip), %rsi
	movdqa	.LC0(%rip), %xmm0
	movdqa	.LC1(%rip), %xmm2
	shrl	$2, %edx
	leaq	16(%rsi), %r8
	movq	%rsi, %rax
	subl	$1, %edx
	salq	$4, %rdx
	addq	%r8, %rdx
	.p2align 4,,10
	.p2align 3
.L4:
	movdqa	%xmm0, %xmm1
	addq	$16, %rax
	paddd	%xmm2, %xmm0
	movaps	%xmm1, -16(%rax)
	cmpq	%rdx, %rax
	jne	.L4
	movl	%edi, %eax
	andl	$-4, %eax
	andl	$3, %edi
	je	.L9
.L3:
	movslq	%eax, %rdx
	movl	%eax, (%rsi,%rdx,4)
	leal	1(%rax), %edx
	cmpl	%edx, %ecx
	jl	.L1
	movslq	%edx, %rdi
	addl	$2, %eax
	movl	%edx, (%rsi,%rdi,4)
	cmpl	%eax, %ecx
	jl	.L1
	movslq	%eax, %rdx
	movl	%eax, (%rsi,%rdx,4)
.L1:
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	ret
.L6:
	xorl	%eax, %eax
	leaq	f(%rip), %rsi
	jmp	.L3
	.cfi_endproc
.LFE23:
	.size	init, .-init
	.p2align 4
	.globl	find
	.type	find, @function
find:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movslq	%edi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	f(%rip), %rbx
	movq	%rbp, %rax
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	movl	(%rbx,%rbp,4), %edx
	cmpl	%ebp, %edx
	jne	.L21
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L21:
	.cfi_restore_state
	movslq	%edx, %r13
	leaq	dis(%rip), %r12
	movl	(%rbx,%r13,4), %eax
	movslq	%eax, %rcx
	cmpl	%eax, %edx
	je	.L12
	movslq	%eax, %r14
	movslq	(%rbx,%r14,4), %rdx
	cmpl	%edx, %eax
	jne	.L22
.L13:
	movl	(%r12,%rdx,4), %edx
	addl	%edx, (%r12,%r13,4)
	movl	%eax, (%rbx,%r13,4)
	movslq	(%rbx,%rbp,4), %rcx
.L12:
	movl	%eax, (%rbx,%rbp,4)
	movl	(%r12,%rcx,4), %edx
	addl	%edx, (%r12,%rbp,4)
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L22:
	.cfi_restore_state
	movslq	%edx, %r15
	movslq	(%rbx,%r15,4), %rdi
	movl	%edi, %eax
	cmpl	%edi, %edx
	je	.L14
	call	find
	movslq	(%rbx,%r15,4), %rdx
	movl	%eax, (%rbx,%r15,4)
	movslq	(%rbx,%r14,4), %rdi
	movl	(%r12,%rdx,4), %edx
	addl	%edx, (%r12,%r15,4)
.L14:
	movl	(%r12,%rdi,4), %edx
	movl	%eax, (%rbx,%r14,4)
	addl	%edx, (%r12,%r14,4)
	movslq	(%rbx,%r13,4), %rdx
	jmp	.L13
	.cfi_endproc
.LFE24:
	.size	find, .-find
	.p2align 4
	.globl	find_father
	.type	find_father, @function
find_father:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	f(%rip), %r8
	movl	%esi, %r11d
	movl	%edx, %r9d
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	dis(%rip), %rsi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movslq	%edi, %rbx
	movl	(%r8,%rbx,4), %r10d
	cmpl	%r10d, %edi
	jne	.L42
	movslq	%r11d, %rbp
	movslq	(%r8,%rbp,4), %rdx
	cmpl	%edx, %r11d
	jne	.L28
.L45:
	movl	(%rsi,%rbp,4), %ecx
	movl	(%rsi,%rbx,4), %eax
	cmpl	%r10d, %edx
	je	.L43
.L32:
	addl	%eax, %r9d
	movl	%r10d, (%r8,%rdx,4)
	movl	$1, %eax
	subl	%ecx, %r9d
	movl	%r9d, (%rsi,%rdx,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
.L42:
	.cfi_restore_state
	movslq	%r10d, %rbp
	movl	(%r8,%rbp,4), %eax
	movslq	%eax, %rdx
	cmpl	%eax, %r10d
	je	.L25
	movslq	%eax, %r10
	movslq	(%r8,%r10,4), %rdx
	cmpl	%edx, %eax
	jne	.L44
.L26:
	movl	(%rsi,%rdx,4), %edx
	movl	%eax, (%r8,%rbp,4)
	addl	%edx, (%rsi,%rbp,4)
	movslq	(%r8,%rbx,4), %rdx
.L25:
	movslq	%r11d, %rbp
	movl	(%rsi,%rdx,4), %edx
	movl	%eax, (%r8,%rbx,4)
	movl	%eax, %r10d
	addl	%edx, (%rsi,%rbx,4)
	movslq	(%r8,%rbp,4), %rdx
	cmpl	%edx, %r11d
	je	.L45
.L28:
	movslq	%edx, %r11
	movl	(%r8,%r11,4), %eax
	movl	%eax, %ecx
	cmpl	%eax, %edx
	je	.L30
	movslq	%eax, %r12
	movslq	(%r8,%r12,4), %rdi
	cmpl	%edi, %eax
	jne	.L46
.L31:
	movl	(%rsi,%rdi,4), %edx
	addl	%edx, (%rsi,%r11,4)
	movl	%eax, (%r8,%r11,4)
	movl	(%r8,%rbp,4), %ecx
.L30:
	movslq	%ecx, %rdx
	movl	(%rsi,%rbp,4), %ecx
	movl	%eax, (%r8,%rbp,4)
	addl	(%rsi,%rdx,4), %ecx
	movslq	%eax, %rdx
	movl	%ecx, (%rsi,%rbp,4)
	movl	(%rsi,%rbx,4), %eax
	cmpl	%r10d, %edx
	jne	.L32
.L43:
	subl	%eax, %ecx
	xorl	%eax, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	cmpl	%r9d, %ecx
	popq	%r12
	.cfi_def_cfa_offset 8
	sete	%al
	ret
	.p2align 4,,10
	.p2align 3
.L46:
	.cfi_restore_state
	call	find
	movslq	(%r8,%r12,4), %rdx
	movl	%eax, (%r8,%r12,4)
	movslq	(%r8,%r11,4), %rdi
	movl	(%rsi,%rdx,4), %edx
	addl	%edx, (%rsi,%r12,4)
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L44:
	movslq	%edx, %r12
	movslq	(%r8,%r12,4), %rdi
	movl	%edi, %eax
	cmpl	%edi, %edx
	je	.L27
	call	find
	movslq	(%r8,%r12,4), %rdx
	movl	%eax, (%r8,%r12,4)
	movslq	(%r8,%r10,4), %rdi
	movl	(%rsi,%rdx,4), %edx
	addl	%edx, (%rsi,%r12,4)
.L27:
	movl	(%rsi,%rdi,4), %edx
	movl	%eax, (%r8,%r10,4)
	addl	%edx, (%rsi,%r10,4)
	movslq	(%r8,%rbp,4), %rdx
	jmp	.L26
	.cfi_endproc
.LFE25:
	.size	find_father, .-find_father
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"%d %d"
.LC3:
	.string	"Yes"
.LC4:
	.string	"%d %d %d"
.LC5:
	.string	"No"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB26:
	.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	.LC2(%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	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	N(%rip), %ecx
	testl	%ecx, %ecx
	js	.L54
	leal	1(%rcx), %edi
	cmpl	$2, %ecx
	jle	.L70
	movl	%edi, %edx
	leaq	f(%rip), %rsi
	movdqa	.LC0(%rip), %xmm0
	movdqa	.LC1(%rip), %xmm2
	shrl	$2, %edx
	leaq	16(%rsi), %r8
	movq	%rsi, %rax
	subl	$1, %edx
	salq	$4, %rdx
	addq	%r8, %rdx
	.p2align 4,,10
	.p2align 3
.L52:
	movdqa	%xmm0, %xmm1
	addq	$16, %rax
	paddd	%xmm2, %xmm0
	movaps	%xmm1, -16(%rax)
	cmpq	%rax, %rdx
	jne	.L52
	movl	%edi, %eax
	andl	$-4, %eax
	andl	$3, %edi
	je	.L54
.L51:
	movslq	%eax, %rdx
	movl	%eax, (%rsi,%rdx,4)
	leal	1(%rax), %edx
	cmpl	%edx, %ecx
	jl	.L54
	movslq	%edx, %rdi
	addl	$2, %eax
	movl	%edx, (%rsi,%rdi,4)
	cmpl	%ecx, %eax
	jg	.L54
	movslq	%eax, %rdx
	movl	%eax, (%rsi,%rdx,4)
.L54:
	movl	M(%rip), %ecx
	testl	%ecx, %ecx
	jle	.L50
	movl	$1, %ebx
	leaq	52(%rsp), %r15
	leaq	48(%rsp), %r14
	movl	$1, 12(%rsp)
	leaq	44(%rsp), %r13
	leaq	f(%rip), %r12
	leaq	dis(%rip), %rbp
	jmp	.L49
	.p2align 4,,10
	.p2align 3
.L57:
	addl	$1, %ebx
	cmpl	%ebx, M(%rip)
	jl	.L82
.L49:
	movq	%r14, %rdx
	movq	%r15, %rcx
	movq	%r13, %rsi
	xorl	%eax, %eax
	leaq	.LC4(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	testl	%edx, %edx
	je	.L57
	movslq	44(%rsp), %r10
	movl	52(%rsp), %r9d
	movl	48(%rsp), %r8d
	movl	(%r12,%r10,4), %esi
	cmpl	%esi, %r10d
	je	.L58
	movslq	%esi, %r11
	movl	(%r12,%r11,4), %eax
	movslq	%eax, %rcx
	cmpl	%eax, %esi
	je	.L59
	movslq	%eax, %rsi
	movl	(%r12,%rsi,4), %edi
	cmpl	%edi, %eax
	jne	.L83
.L60:
	movslq	(%r12,%r11,4), %rax
	movl	%edi, (%r12,%r11,4)
	movslq	(%r12,%r10,4), %rcx
	movl	0(%rbp,%rax,4), %eax
	addl	%eax, 0(%rbp,%r11,4)
	movl	%edi, %eax
.L59:
	movl	0(%rbp,%rcx,4), %ecx
	addl	%ecx, 0(%rbp,%r10,4)
	movl	%eax, %esi
	movl	%eax, (%r12,%r10,4)
.L58:
	movslq	%r8d, %r11
	movslq	(%r12,%r11,4), %rdi
	cmpl	%edi, %r8d
	jne	.L62
	movl	0(%rbp,%r11,4), %edx
	movl	0(%rbp,%r10,4), %eax
	cmpl	%esi, %edi
	je	.L84
.L67:
	addl	%eax, %r9d
	addl	$1, %ebx
	movl	%esi, (%r12,%rdi,4)
	subl	%edx, %r9d
	cmpl	%ebx, M(%rip)
	movl	%r9d, 0(%rbp,%rdi,4)
	jge	.L49
.L82:
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jne	.L50
	leaq	.LC5(%rip), %rdi
	call	puts@PLT
.L56:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L85
	addq	$72, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L62:
	.cfi_restore_state
	movslq	%edi, %r8
	movl	(%r12,%r8,4), %eax
	movslq	%eax, %rcx
	cmpl	%eax, %edi
	je	.L64
	movslq	%eax, %rcx
	movl	(%r12,%rcx,4), %edi
	cmpl	%edi, %eax
	jne	.L86
.L65:
	movslq	(%r12,%r8,4), %rax
	movl	%edi, (%r12,%r8,4)
	movslq	(%r12,%r11,4), %rcx
	movl	0(%rbp,%rax,4), %eax
	addl	%eax, 0(%rbp,%r8,4)
	movl	%edi, %eax
.L64:
	movl	0(%rbp,%r11,4), %edx
	movslq	%eax, %rdi
	addl	0(%rbp,%rcx,4), %edx
	movl	%eax, (%r12,%r11,4)
	movl	%edx, 0(%rbp,%r11,4)
	movl	0(%rbp,%r10,4), %eax
	cmpl	%esi, %edi
	jne	.L67
.L84:
	subl	%eax, %edx
	xorl	%eax, %eax
	cmpl	%r9d, %edx
	sete	%al
	movl	%eax, 12(%rsp)
	jmp	.L57
.L50:
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
	jmp	.L56
.L86:
	movslq	%edi, %rdx
	movl	(%r12,%rdx,4), %eax
	movq	%rdx, 16(%rsp)
	cmpl	%eax, %edi
	jne	.L87
.L66:
	movslq	(%r12,%rcx,4), %rdi
	movl	%eax, (%r12,%rcx,4)
	movl	0(%rbp,%rdi,4), %edi
	addl	%edi, 0(%rbp,%rcx,4)
	movl	%eax, %edi
	jmp	.L65
.L83:
	movslq	%edi, %rcx
	movl	(%r12,%rcx,4), %eax
	movq	%rcx, 16(%rsp)
	cmpl	%eax, %edi
	jne	.L88
.L61:
	movslq	(%r12,%rsi,4), %rcx
	movl	%eax, %edi
	movl	%eax, (%r12,%rsi,4)
	movl	0(%rbp,%rcx,4), %ecx
	addl	%ecx, 0(%rbp,%rsi,4)
	jmp	.L60
.L88:
	movl	%eax, %edi
	call	find
	movq	16(%rsp), %rcx
	movslq	(%r12,%rcx,4), %rdi
	movl	%eax, (%r12,%rcx,4)
	movl	0(%rbp,%rdi,4), %edi
	addl	%edi, 0(%rbp,%rcx,4)
	jmp	.L61
.L87:
	movl	%eax, %edi
	movq	%rcx, 24(%rsp)
	call	find
	movq	16(%rsp), %rdx
	movq	24(%rsp), %rcx
	movslq	(%r12,%rdx,4), %rdi
	movl	%eax, (%r12,%rdx,4)
	movl	0(%rbp,%rdi,4), %edi
	addl	%edi, 0(%rbp,%rdx,4)
	jmp	.L66
.L70:
	xorl	%eax, %eax
	leaq	f(%rip), %rsi
	jmp	.L51
.L85:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE26:
	.size	main, .-main
	.globl	dis
	.bss
	.align 32
	.type	dis, @object
	.size	dis, 404000
dis:
	.zero	404000
	.globl	f
	.align 32
	.type	f, @object
	.size	f, 404000
f:
	.zero	404000
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC1:
	.long	4
	.long	4
	.long	4
	.long	4
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include<stdio.h>
#define MAXN 101000
int N, M;
int f[MAXN], dis[MAXN];
void init()
{
	for (int i = 0; i <= N; i++)
	{
		f[i] = i;
	}
}
int find(int x)
{
	if (f[x] == x)
		return x;
	else
	{
		int r = find(f[x]);
		dis[x] = dis[f[x]] + dis[x];
		return f[x] = r;
	}
}
int find_father(int x,int y,int z)
{
	int fx = find(x);
	int fy = find(y);
	if (fx == fy)
	{
		return z == dis[y] - dis[x];
	}
	f[fy] = fx;
	dis[fy] = dis[x] + z - dis[y];
	return 1;
}
int main()
{
	int a = 1;
	scanf("%d %d", &N, &M);
	init();
	for (int i = 1; i <= M; i++)
	{
		int x, y, z;
		scanf("%d %d %d", &x, &y, &z);
		if (a)
			a = find_father(x, y, z);
	}
	if (a)
		printf("Yes\n");
	else
		printf("No\n");
	return 0;
}
3 3
1 2 1
2 3 1
1 3 2

Yes

Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
#define MAXN 101000
int N, M;
int f[MAXN], dis[MAXN];
void init()
{
	for (int i = 0; i <= N; i++)
	{
		f[i] = i;
	}
}
int find(int x)
{
	if (f[x] == x)
		return x;
	else
	{
		int r = find(f[x]);
		dis[x] = dis[f[x]] + dis[x];
		return f[x] = r;
	}
}
int find_father(int x,int y,int z)
{
	int fx = find(x);
	int fy = find(y);
	if (fx == fy)
	{
		return z == dis[y] - dis[x];
	}
	f[fy] = fx;
	dis[fy] = dis[x] + z - dis[y];
	return 1;
}
int main()
{
	int a = 1;
	scanf("%d %d", &N, &M);
	init();
	for (int i = 1; i <= M; i++)
	{
		int x, y, z;
		scanf("%d %d %d", &x, &y, &z);
		if (a)
			a = find_father(x, y, z);
	}
	if (a)
		printf("Yes\n");
	else
		printf("No\n");
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	f
	.align 32
	.type	f, @object
	.size	f, 404000
f:
	.zero	404000
	.globl	dis
	.align 32
	.type	dis, @object
	.size	dis, 404000
dis:
	.zero	404000
	.text
	.globl	init
	.type	init, @function
init:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -4(%rbp)
	jmp	.L2
.L3:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	f(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	addl	$1, -4(%rbp)
.L2:
	movl	N(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L3
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	init, .-init
	.globl	find
	.type	find, @function
find:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	f(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -20(%rbp)
	jne	.L5
	movl	-20(%rbp), %eax
	jmp	.L6
.L5:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	f(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %edi
	call	find
	movl	%eax, -4(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	f(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dis(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dis(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dis(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	f(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	f(%rip), %rax
	movl	(%rdx,%rax), %eax
.L6:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	find, .-find
	.globl	find_father
	.type	find_father, @function
find_father:
.LFB2:
	.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	%edx, -28(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	find
	movl	%eax, -8(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	call	find
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jne	.L8
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dis(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	dis(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	cmpl	%eax, -28(%rbp)
	sete	%al
	movzbl	%al, %eax
	jmp	.L9
.L8:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	f(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dis(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-28(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dis(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	%eax, %ecx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dis(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	$1, %eax
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	find_father, .-find_father
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d %d %d"
.LC2:
	.string	"Yes"
.LC3:
	.string	"No"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1, -16(%rbp)
	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
	movl	$0, %eax
	call	init
	movl	$1, -12(%rbp)
	jmp	.L11
.L13:
	leaq	-20(%rbp), %rcx
	leaq	-24(%rbp), %rdx
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$0, -16(%rbp)
	je	.L12
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %ecx
	movl	-28(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	find_father
	movl	%eax, -16(%rbp)
.L12:
	addl	$1, -12(%rbp)
.L11:
	movl	M(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L13
	cmpl	$0, -16(%rbp)
	je	.L14
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L15
.L14:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L15:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	f
	.align 32
	.type	f, @object
	.size	f, 404000
f:
	.zero	404000
	.globl	dis
	.align 32
	.type	dis, @object
	.size	dis, 404000
dis:
	.zero	404000
	.text
	.globl	init
	.type	init, @function
init:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -4(%rbp)
	jmp	.L2
.L3:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	f(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	addl	$1, -4(%rbp)
.L2:
	movl	N(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L3
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	init, .-init
	.globl	find
	.type	find, @function
find:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	f(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -20(%rbp)
	jne	.L5
	movl	-20(%rbp), %eax
	jmp	.L6
.L5:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	f(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %edi
	call	find
	movl	%eax, -4(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	f(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dis(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dis(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dis(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	f(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	f(%rip), %rax
	movl	(%rdx,%rax), %eax
.L6:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	find, .-find
	.globl	find_father
	.type	find_father, @function
find_father:
.LFB2:
	.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	%edx, -28(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	find
	movl	%eax, -8(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	call	find
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jne	.L8
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dis(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	dis(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	cmpl	%eax, -28(%rbp)
	sete	%al
	movzbl	%al, %eax
	jmp	.L9
.L8:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	f(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dis(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-28(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dis(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	%eax, %ecx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dis(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	$1, %eax
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	find_father, .-find_father
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d %d %d"
.LC2:
	.string	"Yes"
.LC3:
	.string	"No"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1, -16(%rbp)
	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
	movl	$0, %eax
	call	init
	movl	$1, -12(%rbp)
	jmp	.L11
.L13:
	leaq	-20(%rbp), %rcx
	leaq	-24(%rbp), %rdx
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$0, -16(%rbp)
	je	.L12
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %ecx
	movl	-28(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	find_father
	movl	%eax, -16(%rbp)
.L12:
	addl	$1, -12(%rbp)
.L11:
	movl	M(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L13
	cmpl	$0, -16(%rbp)
	je	.L14
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L15
.L14:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L15:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
