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

typedef int32_t i32;

#define ALLOC(size,type) ((type *) calloc ((size), sizeof (type)))

typedef struct union_find_depth {
  i32 *parent;
  i32 *depth;
  i32 size;
} union_find;

union_find* new_union_find (const i32 n) {
  union_find *u = ALLOC (1, union_find);
  u->parent = ALLOC (n, i32);
  u->depth = ALLOC (n, i32);
  u->size = n;
  for (i32 i = 0; i < n; ++i) {
    u->parent[i] = -1;
  }
  return u;
}

i32 root (union_find *u, i32 x) {
  while (u->parent[x] >= 0) {
    x = u->parent[x];
  }
  return x;
}

i32 depth (union_find *u, i32 x) {
  i32 sum = 0;
  while (u->parent[x] >= 0) {
    sum += u->depth[x];
    x = u->parent[x];
  }
  return sum;
}

int unite (union_find *u, i32 x, i32 y, i32 w) {
  w += depth (u, x);
  w -= depth (u, y);
  x = root (u, x);
  y = root (u, y);
  if (x == y) {
    return w == 0;
  }
  if (u->parent[x] > u->parent[y]) {
    i32 swap = x;
    x = y;
    y = swap;
    w = -w;
  }
  u->depth[y] = w;
  u->parent[x] += u->parent[y];
  u->parent[y] = x;
  return 1;
}

void run (void) {
  i32 n, m;
  scanf ("%" SCNi32 "%" SCNi32, &n, &m);
  union_find *u = new_union_find (n + 1);
  while (m--) {
    i32 l, r, d;
    scanf ("%" SCNi32 "%" SCNi32 "%" SCNi32, &l, &r, &d);
    if (!unite (u, l, r, d)) {
      puts ("No");
      return;
    }
  }
  puts ("Yes");
}

int main (void) {
  run();
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	new_union_find
	.type	new_union_find, @function
new_union_find:
.LFB6:
	.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	$24, %esi
	movl	$1, %edi
	call	calloc@PLT
	movq	%rax, -8(%rbp)
	movl	-20(%rbp), %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, (%rax)
	movl	-20(%rbp), %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 8(%rax)
	movq	-8(%rbp), %rax
	movl	-20(%rbp), %edx
	movl	%edx, 16(%rax)
	movl	$0, -12(%rbp)
	jmp	.L2
.L3:
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movl	-12(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	$-1, (%rax)
	addl	$1, -12(%rbp)
.L2:
	movl	-12(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L3
	movq	-8(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	new_union_find, .-new_union_find
	.globl	root
	.type	root, @function
root:
.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)
	movl	%esi, -12(%rbp)
	jmp	.L6
.L7:
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movl	-12(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -12(%rbp)
.L6:
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movl	-12(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jns	.L7
	movl	-12(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	root, .-root
	.globl	depth
	.type	depth, @function
depth:
.LFB8:
	.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)
	movl	%esi, -28(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L10
.L11:
	movq	-24(%rbp), %rax
	movq	8(%rax), %rdx
	movl	-28(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -4(%rbp)
	movq	-24(%rbp), %rax
	movq	(%rax), %rdx
	movl	-28(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -28(%rbp)
.L10:
	movq	-24(%rbp), %rax
	movq	(%rax), %rdx
	movl	-28(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jns	.L11
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	depth, .-depth
	.globl	unite
	.type	unite, @function
unite:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$40, %rsp
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	%ecx, -36(%rbp)
	movl	-28(%rbp), %edx
	movq	-24(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	depth
	addl	%eax, -36(%rbp)
	movl	-32(%rbp), %edx
	movq	-24(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	depth
	subl	%eax, -36(%rbp)
	movl	-28(%rbp), %edx
	movq	-24(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	root
	movl	%eax, -28(%rbp)
	movl	-32(%rbp), %edx
	movq	-24(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	root
	movl	%eax, -32(%rbp)
	movl	-28(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jne	.L14
	cmpl	$0, -36(%rbp)
	sete	%al
	movzbl	%al, %eax
	jmp	.L15
.L14:
	movq	-24(%rbp), %rax
	movq	(%rax), %rdx
	movl	-28(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movq	-24(%rbp), %rax
	movq	(%rax), %rcx
	movl	-32(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jle	.L16
	movl	-28(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -32(%rbp)
	negl	-36(%rbp)
.L16:
	movq	-24(%rbp), %rax
	movq	8(%rax), %rdx
	movl	-32(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	movl	-36(%rbp), %eax
	movl	%eax, (%rdx)
	movq	-24(%rbp), %rax
	movq	(%rax), %rdx
	movl	-28(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %ecx
	movq	-24(%rbp), %rax
	movq	(%rax), %rdx
	movl	-32(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movq	-24(%rbp), %rax
	movq	(%rax), %rsi
	movl	-28(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rsi, %rax
	addl	%ecx, %edx
	movl	%edx, (%rax)
	movq	-24(%rbp), %rax
	movq	(%rax), %rdx
	movl	-32(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	movl	-28(%rbp), %eax
	movl	%eax, (%rdx)
	movl	$1, %eax
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	unite, .-unite
	.section	.rodata
.LC0:
	.string	"%i%i"
.LC1:
	.string	"%i%i%i"
.LC2:
	.string	"No"
.LC3:
	.string	"Yes"
	.text
	.globl	run
	.type	run, @function
run:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edi
	call	new_union_find
	movq	%rax, -16(%rbp)
	jmp	.L18
.L21:
	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
	movl	-20(%rbp), %ecx
	movl	-24(%rbp), %edx
	movl	-28(%rbp), %esi
	movq	-16(%rbp), %rax
	movq	%rax, %rdi
	call	unite
	testl	%eax, %eax
	jne	.L18
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L17
.L18:
	movl	-32(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -32(%rbp)
	testl	%eax, %eax
	jne	.L21
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L17:
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	run, .-run
	.globl	main
	.type	main, @function
main:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	call	run
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.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	new_union_find
	.type	new_union_find, @function
new_union_find:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	$24, %esi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movslq	%edi, %rbp
	movl	$1, %edi
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	call	calloc@PLT
	movl	$4, %esi
	movq	%rbp, %rdi
	movq	%rax, %r12
	call	calloc@PLT
	movl	$4, %esi
	movq	%rbp, %rdi
	movq	%rax, (%r12)
	movq	%rax, %r13
	call	calloc@PLT
	movl	%ebp, 16(%r12)
	movq	%rax, 8(%r12)
	testl	%ebp, %ebp
	jle	.L1
	leaq	0(,%rbp,4), %rdx
	movl	$255, %esi
	movq	%r13, %rdi
	call	memset@PLT
.L1:
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	movq	%r12, %rax
	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
	.cfi_endproc
.LFE39:
	.size	new_union_find, .-new_union_find
	.p2align 4
	.globl	root
	.type	root, @function
root:
.LFB40:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rcx
	.p2align 4,,10
	.p2align 3
.L6:
	movslq	%esi, %rdx
	movl	(%rcx,%rdx,4), %esi
	movq	%rdx, %rax
	testl	%esi, %esi
	jns	.L6
	ret
	.cfi_endproc
.LFE40:
	.size	root, .-root
	.p2align 4
	.globl	depth
	.type	depth, @function
depth:
.LFB41:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rcx
	movslq	%esi, %rsi
	leaq	0(,%rsi,4), %rdx
	movslq	(%rcx,%rsi,4), %rax
	testl	%eax, %eax
	js	.L11
	movq	8(%rdi), %rsi
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L10:
	addl	(%rsi,%rdx), %r8d
	leaq	0(,%rax,4), %rdx
	movslq	(%rcx,%rax,4), %rax
	testl	%eax, %eax
	jns	.L10
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	xorl	%r8d, %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE41:
	.size	depth, .-depth
	.p2align 4
	.globl	unite
	.type	unite, @function
unite:
.LFB42:
	.cfi_startproc
	endbr64
	movq	%rdi, %r10
	movl	%edx, %r8d
	movslq	%esi, %rax
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	(%r10), %rdx
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%rax, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movl	%ecx, %ebx
	movl	(%rdx,%rax,4), %ecx
	testl	%ecx, %ecx
	js	.L14
	movq	8(%r10), %r11
	leaq	0(,%rax,4), %r9
	xorl	%esi, %esi
	movslq	%ecx, %rax
	.p2align 4,,10
	.p2align 3
.L15:
	addl	(%r11,%r9), %esi
	leaq	0(,%rax,4), %r9
	movslq	(%rdx,%rax,4), %rax
	testl	%eax, %eax
	jns	.L15
	addl	%esi, %ebx
.L14:
	movslq	%r8d, %rax
	movl	(%rdx,%rax,4), %esi
	leaq	0(,%rax,4), %r11
	testl	%esi, %esi
	js	.L16
	movq	8(%r10), %rbp
	movslq	%esi, %rax
	xorl	%r9d, %r9d
	.p2align 4,,10
	.p2align 3
.L17:
	addl	0(%rbp,%r11), %r9d
	leaq	0(,%rax,4), %r11
	movslq	(%rdx,%rax,4), %rax
	testl	%eax, %eax
	jns	.L17
	movl	%ebx, %ebp
	subl	%r9d, %ebp
	testl	%ecx, %ecx
	js	.L23
	.p2align 4,,10
	.p2align 3
.L21:
	movslq	%ecx, %rax
	movl	(%rdx,%rax,4), %ecx
	movq	%rax, %rdi
	testl	%ecx, %ecx
	jns	.L21
	testl	%esi, %esi
	js	.L20
	.p2align 4,,10
	.p2align 3
.L23:
	movslq	%esi, %rax
	movl	(%rdx,%rax,4), %esi
	movq	%rax, %r8
	testl	%esi, %esi
	jns	.L23
.L20:
	cmpl	%edi, %r8d
	je	.L35
	movslq	%edi, %r11
	movslq	%r8d, %rax
	salq	$2, %r11
	salq	$2, %rax
	leaq	(%rdx,%r11), %r12
	addq	%rax, %rdx
	cmpl	%esi, %ecx
	jg	.L36
.L26:
	movq	8(%r10), %rcx
	movl	%ebp, (%rcx,%rax)
	movl	(%rdx), %eax
	addl	%eax, (%r12)
	movl	$1, %eax
	movl	%edi, (%rdx)
	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
.L36:
	.cfi_restore_state
	movq	%r12, %rax
	subl	%ebx, %r9d
	movq	%rdx, %r12
	movl	%r8d, %edi
	movq	%rax, %rdx
	movl	%r9d, %ebp
	movq	%r11, %rax
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L35:
	xorl	%eax, %eax
	testl	%ebp, %ebp
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	sete	%al
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	movl	%ebx, %ebp
	xorl	%r9d, %r9d
	testl	%ecx, %ecx
	jns	.L21
	jmp	.L20
	.cfi_endproc
.LFE42:
	.size	unite, .-unite
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%i%i"
.LC1:
	.string	"%i%i%i"
.LC2:
	.string	"No"
.LC3:
	.string	"Yes"
	.text
	.p2align 4
	.globl	run
	.type	run, @function
run:
.LFB43:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$32, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdx
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r12d
	movl	$24, %esi
	movl	$1, %edi
	call	calloc@PLT
	movl	$4, %esi
	leal	1(%r12), %r13d
	movq	%rax, %rbx
	movslq	%r13d, %r14
	movq	%r14, %rdi
	call	calloc@PLT
	movl	$4, %esi
	movq	%r14, %rdi
	movq	%rax, (%rbx)
	movq	%rax, %rbp
	call	calloc@PLT
	movl	%r13d, 16(%rbx)
	movq	%rax, 8(%rbx)
	testl	%r13d, %r13d
	jle	.L38
	leaq	4(,%r12,4), %rdx
	movl	$255, %esi
	movq	%rbp, %rdi
	call	memset@PLT
.L38:
	movl	8(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 8(%rsp)
	testl	%eax, %eax
	je	.L39
	leaq	20(%rsp), %r14
	leaq	16(%rsp), %r13
	leaq	12(%rsp), %r12
	leaq	.LC1(%rip), %rbp
	jmp	.L42
	.p2align 4,,10
	.p2align 3
.L40:
	movl	8(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 8(%rsp)
	testl	%eax, %eax
	je	.L39
.L42:
	movq	%r14, %rcx
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %ecx
	movl	16(%rsp), %edx
	movq	%rbx, %rdi
	movl	12(%rsp), %esi
	call	unite
	testl	%eax, %eax
	jne	.L40
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L37
	.p2align 4,,10
	.p2align 3
.L39:
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
.L37:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L49
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L49:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE43:
	.size	run, .-run
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB44:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	call	run
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE44:
	.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:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	new_union_find
	.type	new_union_find, @function
new_union_find:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	$24, %esi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movslq	%edi, %rbp
	movl	$1, %edi
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	call	calloc@PLT
	movl	$4, %esi
	movq	%rbp, %rdi
	movq	%rax, %r12
	call	calloc@PLT
	movl	$4, %esi
	movq	%rbp, %rdi
	movq	%rax, (%r12)
	movq	%rax, %r13
	call	calloc@PLT
	movl	%ebp, 16(%r12)
	movq	%rax, 8(%r12)
	testl	%ebp, %ebp
	jle	.L1
	leaq	0(,%rbp,4), %rdx
	movl	$255, %esi
	movq	%r13, %rdi
	call	memset@PLT
.L1:
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	movq	%r12, %rax
	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
	.cfi_endproc
.LFE39:
	.size	new_union_find, .-new_union_find
	.p2align 4
	.globl	root
	.type	root, @function
root:
.LFB40:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rcx
	.p2align 4,,10
	.p2align 3
.L6:
	movslq	%esi, %rdx
	movl	(%rcx,%rdx,4), %esi
	movq	%rdx, %rax
	testl	%esi, %esi
	jns	.L6
	ret
	.cfi_endproc
.LFE40:
	.size	root, .-root
	.p2align 4
	.globl	depth
	.type	depth, @function
depth:
.LFB41:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rcx
	movslq	%esi, %rsi
	leaq	0(,%rsi,4), %rdx
	movslq	(%rcx,%rsi,4), %rax
	testl	%eax, %eax
	js	.L11
	movq	8(%rdi), %rsi
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L10:
	addl	(%rsi,%rdx), %r8d
	leaq	0(,%rax,4), %rdx
	movslq	(%rcx,%rax,4), %rax
	testl	%eax, %eax
	jns	.L10
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	xorl	%r8d, %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE41:
	.size	depth, .-depth
	.p2align 4
	.globl	unite
	.type	unite, @function
unite:
.LFB42:
	.cfi_startproc
	endbr64
	movq	%rdi, %r10
	movl	%edx, %r8d
	movslq	%esi, %rax
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	(%r10), %rdx
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%rax, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movl	%ecx, %ebx
	movl	(%rdx,%rax,4), %ecx
	testl	%ecx, %ecx
	js	.L14
	movq	8(%r10), %r11
	leaq	0(,%rax,4), %r9
	xorl	%esi, %esi
	movslq	%ecx, %rax
	.p2align 4,,10
	.p2align 3
.L15:
	addl	(%r11,%r9), %esi
	leaq	0(,%rax,4), %r9
	movslq	(%rdx,%rax,4), %rax
	testl	%eax, %eax
	jns	.L15
	addl	%esi, %ebx
.L14:
	movslq	%r8d, %rax
	movl	(%rdx,%rax,4), %esi
	leaq	0(,%rax,4), %r11
	testl	%esi, %esi
	js	.L16
	movq	8(%r10), %rbp
	movslq	%esi, %rax
	xorl	%r9d, %r9d
	.p2align 4,,10
	.p2align 3
.L17:
	addl	0(%rbp,%r11), %r9d
	leaq	0(,%rax,4), %r11
	movslq	(%rdx,%rax,4), %rax
	testl	%eax, %eax
	jns	.L17
	movl	%ebx, %ebp
	subl	%r9d, %ebp
	testl	%ecx, %ecx
	js	.L23
	.p2align 4,,10
	.p2align 3
.L21:
	movslq	%ecx, %rax
	movl	(%rdx,%rax,4), %ecx
	movq	%rax, %rdi
	testl	%ecx, %ecx
	jns	.L21
	testl	%esi, %esi
	js	.L20
	.p2align 4,,10
	.p2align 3
.L23:
	movslq	%esi, %rax
	movl	(%rdx,%rax,4), %esi
	movq	%rax, %r8
	testl	%esi, %esi
	jns	.L23
.L20:
	cmpl	%edi, %r8d
	je	.L35
	movslq	%edi, %r11
	movslq	%r8d, %rax
	salq	$2, %r11
	salq	$2, %rax
	leaq	(%rdx,%r11), %r12
	addq	%rax, %rdx
	cmpl	%esi, %ecx
	jg	.L36
.L26:
	movq	8(%r10), %rcx
	movl	%ebp, (%rcx,%rax)
	movl	(%rdx), %eax
	addl	%eax, (%r12)
	movl	$1, %eax
	movl	%edi, (%rdx)
	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
.L36:
	.cfi_restore_state
	movq	%r12, %rax
	subl	%ebx, %r9d
	movq	%rdx, %r12
	movl	%r8d, %edi
	movq	%rax, %rdx
	movl	%r9d, %ebp
	movq	%r11, %rax
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L35:
	xorl	%eax, %eax
	testl	%ebp, %ebp
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	sete	%al
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	movl	%ebx, %ebp
	xorl	%r9d, %r9d
	testl	%ecx, %ecx
	jns	.L21
	jmp	.L20
	.cfi_endproc
.LFE42:
	.size	unite, .-unite
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%i%i"
.LC1:
	.string	"%i%i%i"
.LC2:
	.string	"No"
.LC3:
	.string	"Yes"
	.text
	.p2align 4
	.globl	run
	.type	run, @function
run:
.LFB43:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$32, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdx
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r12d
	movl	$24, %esi
	movl	$1, %edi
	call	calloc@PLT
	movl	$4, %esi
	leal	1(%r12), %r13d
	movq	%rax, %rbx
	movslq	%r13d, %r14
	movq	%r14, %rdi
	call	calloc@PLT
	movl	$4, %esi
	movq	%r14, %rdi
	movq	%rax, (%rbx)
	movq	%rax, %rbp
	call	calloc@PLT
	movl	%r13d, 16(%rbx)
	movq	%rax, 8(%rbx)
	testl	%r13d, %r13d
	jle	.L38
	leaq	4(,%r12,4), %rdx
	movl	$255, %esi
	movq	%rbp, %rdi
	call	memset@PLT
.L38:
	movl	8(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 8(%rsp)
	testl	%eax, %eax
	je	.L39
	leaq	20(%rsp), %r14
	leaq	16(%rsp), %r13
	leaq	12(%rsp), %r12
	leaq	.LC1(%rip), %rbp
	jmp	.L42
	.p2align 4,,10
	.p2align 3
.L40:
	movl	8(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 8(%rsp)
	testl	%eax, %eax
	je	.L39
.L42:
	movq	%r14, %rcx
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %ecx
	movl	16(%rsp), %edx
	movq	%rbx, %rdi
	movl	12(%rsp), %esi
	call	unite
	testl	%eax, %eax
	jne	.L40
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L37
	.p2align 4,,10
	.p2align 3
.L39:
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
.L37:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L49
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L49:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE43:
	.size	run, .-run
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB44:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	call	run
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE44:
	.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:

#include<stdio.h>
#include<stdlib.h>
#include<stdint.h>
#include<inttypes.h>

typedef int32_t i32;

#define ALLOC(size,type) ((type *) calloc ((size), sizeof (type)))

typedef struct union_find_depth {
  i32 *parent;
  i32 *depth;
  i32 size;
} union_find;

union_find* new_union_find (const i32 n) {
  union_find *u = ALLOC (1, union_find);
  u->parent = ALLOC (n, i32);
  u->depth = ALLOC (n, i32);
  u->size = n;
  for (i32 i = 0; i < n; ++i) {
    u->parent[i] = -1;
  }
  return u;
}

i32 root (union_find *u, i32 x) {
  while (u->parent[x] >= 0) {
    x = u->parent[x];
  }
  return x;
}

i32 depth (union_find *u, i32 x) {
  i32 sum = 0;
  while (u->parent[x] >= 0) {
    sum += u->depth[x];
    x = u->parent[x];
  }
  return sum;
}

int unite (union_find *u, i32 x, i32 y, i32 w) {
  w += depth (u, x);
  w -= depth (u, y);
  x = root (u, x);
  y = root (u, y);
  if (x == y) {
    return w == 0;
  }
  if (u->parent[x] > u->parent[y]) {
    i32 swap = x;
    x = y;
    y = swap;
    w = -w;
  }
  u->depth[y] = w;
  u->parent[x] += u->parent[y];
  u->parent[y] = x;
  return 1;
}

void run (void) {
  i32 n, m;
  scanf ("%" SCNi32 "%" SCNi32, &n, &m);
  union_find *u = new_union_find (n + 1);
  while (m--) {
    i32 l, r, d;
    scanf ("%" SCNi32 "%" SCNi32 "%" SCNi32, &l, &r, &d);
    if (!unite (u, l, r, d)) {
      puts ("No");
      return;
    }
  }
  puts ("Yes");
}

int main (void) {
  run();
  return 0;
}

000 0
 10 3
8 7 000
7 9 100
9 8 100
 4 3
2 1 1
2 3 3
3 4 2
 10 3
8 7 000
7 9 110
9 8 100
 4 3
1 1 1
2 3 3
3 4 2
 10 3
9 7 000
7 9 110
9 8 100
 4 3
1 1 1
2 3 3
4 4 2
 10 3
9 2 000
7 9 110
9 8 100
 4 3
1 1 1
2 3 3
4 4 1
 10 0
9 2 000
7 9 110
9 8 100

Yes
 No
 Yes
 No
 No
 No
 No
 Yes
 No
 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>
#include<stdlib.h>
#include<stdint.h>
#include<inttypes.h>

typedef int32_t i32;

#define ALLOC(size,type) ((type *) calloc ((size), sizeof (type)))

typedef struct union_find_depth {
  i32 *parent;
  i32 *depth;
  i32 size;
} union_find;

union_find* new_union_find (const i32 n) {
  union_find *u = ALLOC (1, union_find);
  u->parent = ALLOC (n, i32);
  u->depth = ALLOC (n, i32);
  u->size = n;
  for (i32 i = 0; i < n; ++i) {
    u->parent[i] = -1;
  }
  return u;
}

i32 root (union_find *u, i32 x) {
  while (u->parent[x] >= 0) {
    x = u->parent[x];
  }
  return x;
}

i32 depth (union_find *u, i32 x) {
  i32 sum = 0;
  while (u->parent[x] >= 0) {
    sum += u->depth[x];
    x = u->parent[x];
  }
  return sum;
}

int unite (union_find *u, i32 x, i32 y, i32 w) {
  w += depth (u, x);
  w -= depth (u, y);
  x = root (u, x);
  y = root (u, y);
  if (x == y) {
    return w == 0;
  }
  if (u->parent[x] > u->parent[y]) {
    i32 swap = x;
    x = y;
    y = swap;
    w = -w;
  }
  u->depth[y] = w;
  u->parent[x] += u->parent[y];
  u->parent[y] = x;
  return 1;
}

void run (void) {
  i32 n, m;
  scanf ("%" SCNi32 "%" SCNi32, &n, &m);
  union_find *u = new_union_find (n + 1);
  while (m--) {
    i32 l, r, d;
    scanf ("%" SCNi32 "%" SCNi32 "%" SCNi32, &l, &r, &d);
    if (!unite (u, l, r, d)) {
      puts ("No");
      return;
    }
  }
  puts ("Yes");
}

int main (void) {
  run();
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	new_union_find
	.type	new_union_find, @function
new_union_find:
.LFB6:
	.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	$24, %esi
	movl	$1, %edi
	call	calloc@PLT
	movq	%rax, -8(%rbp)
	movl	-20(%rbp), %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, (%rax)
	movl	-20(%rbp), %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 8(%rax)
	movq	-8(%rbp), %rax
	movl	-20(%rbp), %edx
	movl	%edx, 16(%rax)
	movl	$0, -12(%rbp)
	jmp	.L2
.L3:
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movl	-12(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	$-1, (%rax)
	addl	$1, -12(%rbp)
.L2:
	movl	-12(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L3
	movq	-8(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	new_union_find, .-new_union_find
	.globl	root
	.type	root, @function
root:
.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)
	movl	%esi, -12(%rbp)
	jmp	.L6
.L7:
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movl	-12(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -12(%rbp)
.L6:
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movl	-12(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jns	.L7
	movl	-12(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	root, .-root
	.globl	depth
	.type	depth, @function
depth:
.LFB8:
	.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)
	movl	%esi, -28(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L10
.L11:
	movq	-24(%rbp), %rax
	movq	8(%rax), %rdx
	movl	-28(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -4(%rbp)
	movq	-24(%rbp), %rax
	movq	(%rax), %rdx
	movl	-28(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -28(%rbp)
.L10:
	movq	-24(%rbp), %rax
	movq	(%rax), %rdx
	movl	-28(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jns	.L11
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	depth, .-depth
	.globl	unite
	.type	unite, @function
unite:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$40, %rsp
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	%ecx, -36(%rbp)
	movl	-28(%rbp), %edx
	movq	-24(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	depth
	addl	%eax, -36(%rbp)
	movl	-32(%rbp), %edx
	movq	-24(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	depth
	subl	%eax, -36(%rbp)
	movl	-28(%rbp), %edx
	movq	-24(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	root
	movl	%eax, -28(%rbp)
	movl	-32(%rbp), %edx
	movq	-24(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	root
	movl	%eax, -32(%rbp)
	movl	-28(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jne	.L14
	cmpl	$0, -36(%rbp)
	sete	%al
	movzbl	%al, %eax
	jmp	.L15
.L14:
	movq	-24(%rbp), %rax
	movq	(%rax), %rdx
	movl	-28(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movq	-24(%rbp), %rax
	movq	(%rax), %rcx
	movl	-32(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jle	.L16
	movl	-28(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -32(%rbp)
	negl	-36(%rbp)
.L16:
	movq	-24(%rbp), %rax
	movq	8(%rax), %rdx
	movl	-32(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	movl	-36(%rbp), %eax
	movl	%eax, (%rdx)
	movq	-24(%rbp), %rax
	movq	(%rax), %rdx
	movl	-28(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %ecx
	movq	-24(%rbp), %rax
	movq	(%rax), %rdx
	movl	-32(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movq	-24(%rbp), %rax
	movq	(%rax), %rsi
	movl	-28(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rsi, %rax
	addl	%ecx, %edx
	movl	%edx, (%rax)
	movq	-24(%rbp), %rax
	movq	(%rax), %rdx
	movl	-32(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	movl	-28(%rbp), %eax
	movl	%eax, (%rdx)
	movl	$1, %eax
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	unite, .-unite
	.section	.rodata
.LC0:
	.string	"%i%i"
.LC1:
	.string	"%i%i%i"
.LC2:
	.string	"No"
.LC3:
	.string	"Yes"
	.text
	.globl	run
	.type	run, @function
run:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edi
	call	new_union_find
	movq	%rax, -16(%rbp)
	jmp	.L18
.L21:
	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
	movl	-20(%rbp), %ecx
	movl	-24(%rbp), %edx
	movl	-28(%rbp), %esi
	movq	-16(%rbp), %rax
	movq	%rax, %rdi
	call	unite
	testl	%eax, %eax
	jne	.L18
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L17
.L18:
	movl	-32(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -32(%rbp)
	testl	%eax, %eax
	jne	.L21
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L17:
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	run, .-run
	.globl	main
	.type	main, @function
main:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	call	run
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.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	new_union_find
	.type	new_union_find, @function
new_union_find:
.LFB6:
	.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	$24, %esi
	movl	$1, %edi
	call	calloc@PLT
	movq	%rax, -8(%rbp)
	movl	-20(%rbp), %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, (%rax)
	movl	-20(%rbp), %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 8(%rax)
	movq	-8(%rbp), %rax
	movl	-20(%rbp), %edx
	movl	%edx, 16(%rax)
	movl	$0, -12(%rbp)
	jmp	.L2
.L3:
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movl	-12(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	$-1, (%rax)
	addl	$1, -12(%rbp)
.L2:
	movl	-12(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L3
	movq	-8(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	new_union_find, .-new_union_find
	.globl	root
	.type	root, @function
root:
.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)
	movl	%esi, -12(%rbp)
	jmp	.L6
.L7:
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movl	-12(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -12(%rbp)
.L6:
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movl	-12(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jns	.L7
	movl	-12(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	root, .-root
	.globl	depth
	.type	depth, @function
depth:
.LFB8:
	.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)
	movl	%esi, -28(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L10
.L11:
	movq	-24(%rbp), %rax
	movq	8(%rax), %rdx
	movl	-28(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -4(%rbp)
	movq	-24(%rbp), %rax
	movq	(%rax), %rdx
	movl	-28(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -28(%rbp)
.L10:
	movq	-24(%rbp), %rax
	movq	(%rax), %rdx
	movl	-28(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jns	.L11
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	depth, .-depth
	.globl	unite
	.type	unite, @function
unite:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$40, %rsp
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	%ecx, -36(%rbp)
	movl	-28(%rbp), %edx
	movq	-24(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	depth
	addl	%eax, -36(%rbp)
	movl	-32(%rbp), %edx
	movq	-24(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	depth
	subl	%eax, -36(%rbp)
	movl	-28(%rbp), %edx
	movq	-24(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	root
	movl	%eax, -28(%rbp)
	movl	-32(%rbp), %edx
	movq	-24(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	root
	movl	%eax, -32(%rbp)
	movl	-28(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jne	.L14
	cmpl	$0, -36(%rbp)
	sete	%al
	movzbl	%al, %eax
	jmp	.L15
.L14:
	movq	-24(%rbp), %rax
	movq	(%rax), %rdx
	movl	-28(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movq	-24(%rbp), %rax
	movq	(%rax), %rcx
	movl	-32(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jle	.L16
	movl	-28(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -32(%rbp)
	negl	-36(%rbp)
.L16:
	movq	-24(%rbp), %rax
	movq	8(%rax), %rdx
	movl	-32(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	movl	-36(%rbp), %eax
	movl	%eax, (%rdx)
	movq	-24(%rbp), %rax
	movq	(%rax), %rdx
	movl	-28(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %ecx
	movq	-24(%rbp), %rax
	movq	(%rax), %rdx
	movl	-32(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movq	-24(%rbp), %rax
	movq	(%rax), %rsi
	movl	-28(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rsi, %rax
	addl	%ecx, %edx
	movl	%edx, (%rax)
	movq	-24(%rbp), %rax
	movq	(%rax), %rdx
	movl	-32(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	movl	-28(%rbp), %eax
	movl	%eax, (%rdx)
	movl	$1, %eax
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	unite, .-unite
	.section	.rodata
.LC0:
	.string	"%i%i"
.LC1:
	.string	"%i%i%i"
.LC2:
	.string	"No"
.LC3:
	.string	"Yes"
	.text
	.globl	run
	.type	run, @function
run:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edi
	call	new_union_find
	movq	%rax, -16(%rbp)
	jmp	.L18
.L21:
	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
	movl	-20(%rbp), %ecx
	movl	-24(%rbp), %edx
	movl	-28(%rbp), %esi
	movq	-16(%rbp), %rax
	movq	%rax, %rdi
	call	unite
	testl	%eax, %eax
	jne	.L18
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L17
.L18:
	movl	-32(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -32(%rbp)
	testl	%eax, %eax
	jne	.L21
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L17:
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	run, .-run
	.globl	main
	.type	main, @function
main:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	call	run
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.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:
