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>

long *tree[100001];

int main(void) {

  long n,u,v;
  scanf("%ld %ld %ld", &n, &u, &v);
  long tree_s[n+1];
  for (long i = 0; i <= n; i++) {
    tree_s[i] = 0;
  }
  long a,b;
  for (long i = 0; i < n-1; i++) {
    scanf("%ld %ld", &a, &b);
    tree[a] = realloc(tree[a], sizeof(long)*(tree_s[a]+1));
    tree[a][tree_s[a]] = b;
    tree_s[a]++;
    tree[b] = realloc(tree[b], sizeof(long)*(tree_s[b]+1));
    tree[b][tree_s[b]] = a;
    tree_s[b]++;
  }
  int visited[n+1];
  long depth_u[n+1],depth_v[n+1];
  for (long i = 0; i <= n; i++) {
    visited[i] = 0;
    depth_u[i] = 0;
    depth_v[i] = 0;
  }
  visited[u] = 1;
  long queue[n];
  queue[0] = u;
  long start = 0, end = 0, tail = 0;
  long cur,next;
  while (tail < n-1) {
    for (long i = start; i <= end; i++) {
      cur = queue[i];
      for (long j = 0; j < tree_s[cur]; j++) {
        next = tree[cur][j];
        if (visited[next] == 1) {
          continue;
        }
        visited[next] = 1;
        depth_u[next] = depth_u[cur]+1;
        tail++;
        queue[tail] = next;
      }
    }
    start = end+1;
    end = tail;
  }
  for (long i = 0; i <= n; i++) {
    visited[i] = 0;
  }
  visited[v] = 1;
  queue[0] = v;
  start = 0; end = 0; tail = 0;
  while (tail < n-1) {
    for (long i = start; i <= end; i++) {
      cur = queue[i];
      for (long j = 0; j < tree_s[cur]; j++) {
        next = tree[cur][j];
        if (visited[next] == 1) {
          continue;
        }
        visited[next] = 1;
        depth_v[next] = depth_v[cur]+1;
        tail++;
        queue[tail] = next;
      }
    }
    start = end+1;
    end = tail;
  }
  long move;
  long max = 0;
  for (long i = 1; i <= n; i++) {
    if (depth_u[i] >= depth_v[i]) {
      continue;
    }
    move = depth_v[i]-1;
    if (move > max) {
      max = move;
    }
  }
  printf("%ld\n", max);

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	tree
	.bss
	.align 32
	.type	tree, @object
	.size	tree, 800008
tree:
	.zero	800008
	.section	.rodata
.LC0:
	.string	"%ld %ld %ld"
.LC1:
	.string	"%ld %ld"
.LC2:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$408, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, -440(%rbp)
	leaq	-288(%rbp), %rcx
	leaq	-296(%rbp), %rdx
	leaq	-304(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-304(%rbp), %rax
	leaq	1(%rax), %rdx
	leaq	-1(%rdx), %rax
	movq	%rax, -160(%rbp)
	movq	%rdx, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	movq	%rdx, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	movq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L2:
	cmpq	%rcx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L4
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -152(%rbp)
	movq	$0, -264(%rbp)
	jmp	.L5
.L6:
	movq	-152(%rbp), %rdx
	movq	-264(%rbp), %rax
	movq	$0, (%rdx,%rax,8)
	addq	$1, -264(%rbp)
.L5:
	movq	-304(%rbp), %rax
	cmpq	%rax, -264(%rbp)
	jle	.L6
	movq	$0, -256(%rbp)
	jmp	.L7
.L8:
	leaq	-272(%rbp), %rdx
	leaq	-280(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-280(%rbp), %rdx
	movq	-152(%rbp), %rax
	movq	(%rax,%rdx,8), %rax
	addq	$1, %rax
	leaq	0(,%rax,8), %rcx
	movq	-280(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	tree(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-280(%rbp), %rbx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	realloc@PLT
	movq	%rax, %rcx
	leaq	0(,%rbx,8), %rdx
	leaq	tree(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movq	-280(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	tree(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movq	-280(%rbp), %rdx
	movq	-152(%rbp), %rax
	movq	(%rax,%rdx,8), %rax
	salq	$3, %rax
	leaq	(%rcx,%rax), %rdx
	movq	-272(%rbp), %rax
	movq	%rax, (%rdx)
	movq	-280(%rbp), %rcx
	movq	-152(%rbp), %rax
	movq	(%rax,%rcx,8), %rax
	leaq	1(%rax), %rdx
	movq	-152(%rbp), %rax
	movq	%rdx, (%rax,%rcx,8)
	movq	-272(%rbp), %rdx
	movq	-152(%rbp), %rax
	movq	(%rax,%rdx,8), %rax
	addq	$1, %rax
	leaq	0(,%rax,8), %rcx
	movq	-272(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	tree(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-272(%rbp), %rbx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	realloc@PLT
	movq	%rax, %rcx
	leaq	0(,%rbx,8), %rdx
	leaq	tree(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movq	-272(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	tree(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movq	-272(%rbp), %rdx
	movq	-152(%rbp), %rax
	movq	(%rax,%rdx,8), %rax
	salq	$3, %rax
	leaq	(%rcx,%rax), %rdx
	movq	-280(%rbp), %rax
	movq	%rax, (%rdx)
	movq	-272(%rbp), %rcx
	movq	-152(%rbp), %rax
	movq	(%rax,%rcx,8), %rax
	leaq	1(%rax), %rdx
	movq	-152(%rbp), %rax
	movq	%rdx, (%rax,%rcx,8)
	addq	$1, -256(%rbp)
.L7:
	movq	-304(%rbp), %rax
	subq	$1, %rax
	cmpq	%rax, -256(%rbp)
	jl	.L8
	movq	-304(%rbp), %rax
	leaq	1(%rax), %rdx
	leaq	-1(%rdx), %rax
	movq	%rax, -144(%rbp)
	movq	%rdx, %rax
	movq	%rax, -320(%rbp)
	movq	$0, -312(%rbp)
	movq	%rdx, %rax
	movq	%rax, -336(%rbp)
	movq	$0, -328(%rbp)
	movq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L9:
	cmpq	%rcx, %rsp
	je	.L10
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L9
.L10:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L11
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L11:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -136(%rbp)
	movq	-304(%rbp), %rax
	addq	$1, %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -128(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -352(%rbp)
	movq	$0, -344(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -368(%rbp)
	movq	$0, -360(%rbp)
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L12:
	cmpq	%rdx, %rsp
	je	.L13
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L12
.L13:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L14
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L14:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -120(%rbp)
	movq	-304(%rbp), %rax
	addq	$1, %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -112(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -384(%rbp)
	movq	$0, -376(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -400(%rbp)
	movq	$0, -392(%rbp)
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L15:
	cmpq	%rdx, %rsp
	je	.L16
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L15
.L16:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L17
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L17:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -104(%rbp)
	movq	$0, -248(%rbp)
	jmp	.L18
.L19:
	movq	-136(%rbp), %rax
	movq	-248(%rbp), %rdx
	movl	$0, (%rax,%rdx,4)
	movq	-120(%rbp), %rax
	movq	-248(%rbp), %rdx
	movq	$0, (%rax,%rdx,8)
	movq	-104(%rbp), %rax
	movq	-248(%rbp), %rdx
	movq	$0, (%rax,%rdx,8)
	addq	$1, -248(%rbp)
.L18:
	movq	-304(%rbp), %rax
	cmpq	%rax, -248(%rbp)
	jle	.L19
	movq	-296(%rbp), %rdx
	movq	-136(%rbp), %rax
	movl	$1, (%rax,%rdx,4)
	movq	-304(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -96(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -416(%rbp)
	movq	$0, -408(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -432(%rbp)
	movq	$0, -424(%rbp)
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L20:
	cmpq	%rdx, %rsp
	je	.L21
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L20
.L21:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L22
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L22:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -88(%rbp)
	movq	-296(%rbp), %rdx
	movq	-88(%rbp), %rax
	movq	%rdx, (%rax)
	movq	$0, -240(%rbp)
	movq	$0, -232(%rbp)
	movq	$0, -224(%rbp)
	jmp	.L23
.L30:
	movq	-240(%rbp), %rax
	movq	%rax, -216(%rbp)
	jmp	.L24
.L29:
	movq	-88(%rbp), %rax
	movq	-216(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, -72(%rbp)
	movq	$0, -208(%rbp)
	jmp	.L25
.L28:
	movq	-72(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	tree(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-208(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -64(%rbp)
	movq	-136(%rbp), %rax
	movq	-64(%rbp), %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	$1, %eax
	je	.L47
	movq	-136(%rbp), %rax
	movq	-64(%rbp), %rdx
	movl	$1, (%rax,%rdx,4)
	movq	-120(%rbp), %rax
	movq	-72(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	leaq	1(%rax), %rcx
	movq	-120(%rbp), %rax
	movq	-64(%rbp), %rdx
	movq	%rcx, (%rax,%rdx,8)
	addq	$1, -224(%rbp)
	movq	-88(%rbp), %rax
	movq	-224(%rbp), %rdx
	movq	-64(%rbp), %rcx
	movq	%rcx, (%rax,%rdx,8)
	jmp	.L27
.L47:
	nop
.L27:
	addq	$1, -208(%rbp)
.L25:
	movq	-152(%rbp), %rax
	movq	-72(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	cmpq	%rax, -208(%rbp)
	jl	.L28
	addq	$1, -216(%rbp)
.L24:
	movq	-216(%rbp), %rax
	cmpq	-232(%rbp), %rax
	jle	.L29
	movq	-232(%rbp), %rax
	addq	$1, %rax
	movq	%rax, -240(%rbp)
	movq	-224(%rbp), %rax
	movq	%rax, -232(%rbp)
.L23:
	movq	-304(%rbp), %rax
	subq	$1, %rax
	cmpq	%rax, -224(%rbp)
	jl	.L30
	movq	$0, -200(%rbp)
	jmp	.L31
.L32:
	movq	-136(%rbp), %rax
	movq	-200(%rbp), %rdx
	movl	$0, (%rax,%rdx,4)
	addq	$1, -200(%rbp)
.L31:
	movq	-304(%rbp), %rax
	cmpq	%rax, -200(%rbp)
	jle	.L32
	movq	-288(%rbp), %rdx
	movq	-136(%rbp), %rax
	movl	$1, (%rax,%rdx,4)
	movq	-288(%rbp), %rdx
	movq	-88(%rbp), %rax
	movq	%rdx, (%rax)
	movq	$0, -240(%rbp)
	movq	$0, -232(%rbp)
	movq	$0, -224(%rbp)
	jmp	.L33
.L40:
	movq	-240(%rbp), %rax
	movq	%rax, -192(%rbp)
	jmp	.L34
.L39:
	movq	-88(%rbp), %rax
	movq	-192(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, -72(%rbp)
	movq	$0, -184(%rbp)
	jmp	.L35
.L38:
	movq	-72(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	tree(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-184(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -64(%rbp)
	movq	-136(%rbp), %rax
	movq	-64(%rbp), %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	$1, %eax
	je	.L48
	movq	-136(%rbp), %rax
	movq	-64(%rbp), %rdx
	movl	$1, (%rax,%rdx,4)
	movq	-104(%rbp), %rax
	movq	-72(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	leaq	1(%rax), %rcx
	movq	-104(%rbp), %rax
	movq	-64(%rbp), %rdx
	movq	%rcx, (%rax,%rdx,8)
	addq	$1, -224(%rbp)
	movq	-88(%rbp), %rax
	movq	-224(%rbp), %rdx
	movq	-64(%rbp), %rcx
	movq	%rcx, (%rax,%rdx,8)
	jmp	.L37
.L48:
	nop
.L37:
	addq	$1, -184(%rbp)
.L35:
	movq	-152(%rbp), %rax
	movq	-72(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	cmpq	%rax, -184(%rbp)
	jl	.L38
	addq	$1, -192(%rbp)
.L34:
	movq	-192(%rbp), %rax
	cmpq	-232(%rbp), %rax
	jle	.L39
	movq	-232(%rbp), %rax
	addq	$1, %rax
	movq	%rax, -240(%rbp)
	movq	-224(%rbp), %rax
	movq	%rax, -232(%rbp)
.L33:
	movq	-304(%rbp), %rax
	subq	$1, %rax
	cmpq	%rax, -224(%rbp)
	jl	.L40
	movq	$0, -176(%rbp)
	movq	$1, -168(%rbp)
	jmp	.L41
.L44:
	movq	-120(%rbp), %rax
	movq	-168(%rbp), %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-104(%rbp), %rax
	movq	-168(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	cmpq	%rax, %rcx
	jge	.L49
	movq	-104(%rbp), %rax
	movq	-168(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	subq	$1, %rax
	movq	%rax, -80(%rbp)
	movq	-80(%rbp), %rax
	cmpq	-176(%rbp), %rax
	jle	.L43
	movq	-80(%rbp), %rax
	movq	%rax, -176(%rbp)
	jmp	.L43
.L49:
	nop
.L43:
	addq	$1, -168(%rbp)
.L41:
	movq	-304(%rbp), %rax
	cmpq	%rax, -168(%rbp)
	jle	.L44
	movq	-176(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-440(%rbp), %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L46
	call	__stack_chk_fail@PLT
.L46:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld %ld %ld"
.LC1:
	.string	"%ld %ld"
.LC2:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-80(%rbp), %rcx
	leaq	-88(%rbp), %rdx
	pushq	%r13
	leaq	-96(%rbp), %rsi
	pushq	%r12
	pushq	%rbx
	subq	$88, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	-96(%rbp), %rax
	movq	%rsp, %rcx
	leaq	1(%rax), %r12
	movq	%rax, -104(%rbp)
	leaq	0(,%r12,8), %r8
	leaq	15(%r8), %rdx
	movq	%rdx, %rax
	andq	$-4096, %rdx
	subq	%rdx, %rcx
	andq	$-16, %rax
	cmpq	%rcx, %rsp
	je	.L3
.L83:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L83
.L3:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	jne	.L84
.L4:
	cmpq	$0, -104(%rbp)
	movq	%rsp, %r15
	js	.L8
	movq	%r8, %rdx
	xorl	%esi, %esi
	movq	%r15, %rdi
	call	memset@PLT
.L8:
	movq	-104(%rbp), %rax
	subq	$1, %rax
	movq	%rax, -112(%rbp)
	testq	%rax, %rax
	jle	.L7
	leaq	-72(%rbp), %rax
	xorl	%ebx, %ebx
	leaq	-64(%rbp), %r13
	movq	%rax, -104(%rbp)
	leaq	tree(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L6:
	movq	-104(%rbp), %rsi
	movq	%r13, %rdx
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movq	-72(%rbp), %r12
	movq	(%r15,%r12,8), %rax
	movq	(%r14,%r12,8), %rdi
	leaq	8(,%rax,8), %rsi
	call	realloc@PLT
	movq	-64(%rbp), %rsi
	movq	%rax, (%r14,%r12,8)
	movq	-72(%rbp), %rax
	movq	(%r15,%rax,8), %rdx
	movq	(%r14,%rax,8), %rax
	movq	%rsi, (%rax,%rdx,8)
	movq	-64(%rbp), %r12
	movq	-72(%rbp), %rax
	movq	(%r14,%r12,8), %rdi
	addq	$1, (%r15,%rax,8)
	movq	(%r15,%r12,8), %rax
	leaq	8(,%rax,8), %rsi
	call	realloc@PLT
	movq	-72(%rbp), %rsi
	movq	%rax, (%r14,%r12,8)
	movq	-64(%rbp), %rax
	movq	(%r15,%rax,8), %rdx
	movq	(%r14,%rax,8), %rax
	movq	%rsi, (%rax,%rdx,8)
	movq	-64(%rbp), %rax
	addq	$1, (%r15,%rax,8)
	movq	-96(%rbp), %rax
	leaq	-1(%rax), %rdx
	cmpq	%rbx, %rdx
	jg	.L6
	movq	%rax, -104(%rbp)
	leaq	1(%rax), %r12
	movq	%rdx, -112(%rbp)
.L7:
	leaq	0(,%r12,4), %rax
	movq	%rsp, %rcx
	leaq	15(%rax), %rdx
	movq	%rax, -120(%rbp)
	movq	%rdx, %rax
	andq	$-4096, %rdx
	subq	%rdx, %rcx
	andq	$-16, %rax
	cmpq	%rcx, %rsp
	je	.L10
.L85:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L85
.L10:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	jne	.L86
.L11:
	salq	$3, %r12
	movq	%rsp, %rcx
	movq	%rsp, %rbx
	leaq	15(%r12), %rax
	movq	%rax, %rsi
	movq	%rax, %rdx
	andq	$-4096, %rsi
	andq	$-16, %rdx
	subq	%rsi, %rcx
.L12:
	cmpq	%rcx, %rsp
	je	.L13
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L12
.L86:
	orq	$0, -8(%rsp,%rax)
	jmp	.L11
.L84:
	orq	$0, -8(%rsp,%rax)
	jmp	.L4
.L13:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L87
.L14:
	movq	%rax, %rdx
	movq	%rsp, %rcx
	andq	$-4096, %rax
	movq	%rsp, %r13
	andq	$-16, %rdx
	subq	%rax, %rcx
.L15:
	cmpq	%rcx, %rsp
	je	.L16
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L15
.L87:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L14
.L16:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L17
	orq	$0, -8(%rsp,%rax)
.L17:
	cmpq	$0, -104(%rbp)
	movq	-88(%rbp), %rcx
	movq	%rsp, %r14
	js	.L18
	movq	-120(%rbp), %rdx
	xorl	%esi, %esi
	movq	%rbx, %rdi
	movq	%rcx, -128(%rbp)
	call	memset@PLT
	movq	%r12, %rdx
	xorl	%esi, %esi
	movq	%r13, %rdi
	call	memset@PLT
	movq	%r12, %rdx
	xorl	%esi, %esi
	movq	%r14, %rdi
	call	memset@PLT
	movq	-128(%rbp), %rcx
	movq	%r12, %rax
	movq	%rsp, %rdx
	andq	$-4096, %r12
	andq	$-16, %rax
	movl	$1, (%rbx,%rcx,4)
	subq	%r12, %rdx
.L19:
	cmpq	%rdx, %rsp
	je	.L20
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L19
.L20:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L21
	orq	$0, -8(%rsp,%rax)
.L21:
	leaq	7(%rsp), %r12
	movq	%r12, %rax
	andq	$-8, %r12
	shrq	$3, %rax
	cmpq	$0, -112(%rbp)
	movq	%rcx, 0(,%rax,8)
	jle	.L22
.L46:
	movq	%r14, -128(%rbp)
	movq	-112(%rbp), %r14
	xorl	%esi, %esi
	xorl	%r9d, %r9d
	leaq	tree(%rip), %r11
	.p2align 4,,10
	.p2align 3
.L23:
	leaq	1(%rsi), %r10
	cmpq	%rsi, %r9
	jg	.L30
	.p2align 4,,10
	.p2align 3
.L27:
	movq	(%r12,%r9,8), %rdi
	movq	(%r15,%rdi,8), %rax
	testq	%rax, %rax
	jle	.L24
	movq	(%r11,%rdi,8), %rdx
	leaq	(%rdx,%rax,8), %r8
	.p2align 4,,10
	.p2align 3
.L26:
	movq	(%rdx), %rax
	cmpl	$1, (%rbx,%rax,4)
	je	.L25
	movq	0(%r13,%rdi,8), %rcx
	addq	$1, %rsi
	movl	$1, (%rbx,%rax,4)
	movq	%rax, (%r12,%rsi,8)
	addq	$1, %rcx
	movq	%rcx, 0(%r13,%rax,8)
.L25:
	addq	$8, %rdx
	cmpq	%rdx, %r8
	jne	.L26
.L24:
	addq	$1, %r9
	cmpq	%r10, %r9
	jne	.L27
.L30:
	movq	%r10, %r9
	cmpq	%rsi, %r14
	jg	.L23
	cmpq	$0, -104(%rbp)
	movq	-128(%rbp), %r14
	js	.L31
.L22:
	movq	-120(%rbp), %rdx
	xorl	%esi, %esi
	movq	%rbx, %rdi
	call	memset@PLT
	movq	-80(%rbp), %rax
	cmpq	$0, -112(%rbp)
	movl	$1, (%rbx,%rax,4)
	movq	%rax, (%r12)
	jle	.L32
.L47:
	movq	%r13, -120(%rbp)
	movq	-112(%rbp), %r13
	xorl	%esi, %esi
	xorl	%r9d, %r9d
	leaq	tree(%rip), %r11
	.p2align 4,,10
	.p2align 3
.L33:
	leaq	1(%rsi), %r10
	cmpq	%rsi, %r9
	jg	.L39
	.p2align 4,,10
	.p2align 3
.L37:
	movq	(%r12,%r9,8), %rdi
	movq	(%r15,%rdi,8), %rax
	testq	%rax, %rax
	jle	.L34
	movq	(%r11,%rdi,8), %rdx
	leaq	(%rdx,%rax,8), %r8
	.p2align 4,,10
	.p2align 3
.L36:
	movq	(%rdx), %rax
	cmpl	$1, (%rbx,%rax,4)
	je	.L35
	movq	(%r14,%rdi,8), %rcx
	addq	$1, %rsi
	movl	$1, (%rbx,%rax,4)
	movq	%rax, (%r12,%rsi,8)
	addq	$1, %rcx
	movq	%rcx, (%r14,%rax,8)
.L35:
	addq	$8, %rdx
	cmpq	%r8, %rdx
	jne	.L36
.L34:
	addq	$1, %r9
	cmpq	%r9, %r10
	jne	.L37
.L39:
	movq	%r10, %r9
	cmpq	%rsi, %r13
	jg	.L33
	movq	-120(%rbp), %r13
.L32:
	movq	-104(%rbp), %rcx
	testq	%rcx, %rcx
	jle	.L50
	movl	$1, %eax
	xorl	%r8d, %r8d
	jmp	.L42
	.p2align 4,,10
	.p2align 3
.L51:
	movq	%rdx, %rax
.L42:
	movq	(%r14,%rax,8), %rdx
	cmpq	%rdx, 0(%r13,%rax,8)
	jge	.L41
	subq	$1, %rdx
	cmpq	%rdx, %r8
	cmovl	%rdx, %r8
.L41:
	leaq	1(%rax), %rdx
	cmpq	%rcx, %rax
	jne	.L51
.L40:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L88
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L44:
	.cfi_restore_state
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L45
	orq	$0, -8(%rsp,%rax)
.L45:
	leaq	7(%rsp), %r12
	movq	%r12, %rax
	andq	$-8, %r12
	shrq	$3, %rax
	cmpq	$0, -112(%rbp)
	movq	%rcx, 0(,%rax,8)
	jg	.L46
.L50:
	xorl	%r8d, %r8d
	jmp	.L40
.L18:
	movl	$1, (%rbx,%rcx,4)
	movq	%r12, %rax
	movq	%rsp, %rdx
	andq	$-4096, %r12
	andq	$-16, %rax
	subq	%r12, %rdx
.L43:
	cmpq	%rdx, %rsp
	je	.L44
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L43
.L31:
	movq	-80(%rbp), %rax
	movl	$1, (%rbx,%rax,4)
	movq	%rax, (%r12)
	jmp	.L47
.L88:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.globl	tree
	.bss
	.align 32
	.type	tree, @object
	.size	tree, 800008
tree:
	.zero	800008
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld %ld %ld"
.LC1:
	.string	"%ld %ld"
.LC2:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-80(%rbp), %rcx
	leaq	-88(%rbp), %rdx
	pushq	%r13
	leaq	-96(%rbp), %rsi
	pushq	%r12
	pushq	%rbx
	subq	$88, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	-96(%rbp), %rax
	movq	%rsp, %rcx
	leaq	1(%rax), %r12
	movq	%rax, -104(%rbp)
	leaq	0(,%r12,8), %r8
	leaq	15(%r8), %rdx
	movq	%rdx, %rax
	andq	$-4096, %rdx
	subq	%rdx, %rcx
	andq	$-16, %rax
	cmpq	%rcx, %rsp
	je	.L3
.L83:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L83
.L3:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	jne	.L84
.L4:
	cmpq	$0, -104(%rbp)
	movq	%rsp, %r15
	js	.L8
	movq	%r8, %rdx
	xorl	%esi, %esi
	movq	%r15, %rdi
	call	memset@PLT
.L8:
	movq	-104(%rbp), %rax
	subq	$1, %rax
	movq	%rax, -112(%rbp)
	testq	%rax, %rax
	jle	.L7
	leaq	-72(%rbp), %rax
	xorl	%ebx, %ebx
	leaq	-64(%rbp), %r13
	movq	%rax, -104(%rbp)
	leaq	tree(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L6:
	movq	-104(%rbp), %rsi
	movq	%r13, %rdx
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movq	-72(%rbp), %r12
	movq	(%r15,%r12,8), %rax
	movq	(%r14,%r12,8), %rdi
	leaq	8(,%rax,8), %rsi
	call	realloc@PLT
	movq	-64(%rbp), %rsi
	movq	%rax, (%r14,%r12,8)
	movq	-72(%rbp), %rax
	movq	(%r15,%rax,8), %rdx
	movq	(%r14,%rax,8), %rax
	movq	%rsi, (%rax,%rdx,8)
	movq	-64(%rbp), %r12
	movq	-72(%rbp), %rax
	movq	(%r14,%r12,8), %rdi
	addq	$1, (%r15,%rax,8)
	movq	(%r15,%r12,8), %rax
	leaq	8(,%rax,8), %rsi
	call	realloc@PLT
	movq	-72(%rbp), %rsi
	movq	%rax, (%r14,%r12,8)
	movq	-64(%rbp), %rax
	movq	(%r15,%rax,8), %rdx
	movq	(%r14,%rax,8), %rax
	movq	%rsi, (%rax,%rdx,8)
	movq	-64(%rbp), %rax
	addq	$1, (%r15,%rax,8)
	movq	-96(%rbp), %rax
	leaq	-1(%rax), %rdx
	cmpq	%rbx, %rdx
	jg	.L6
	movq	%rax, -104(%rbp)
	leaq	1(%rax), %r12
	movq	%rdx, -112(%rbp)
.L7:
	leaq	0(,%r12,4), %rax
	movq	%rsp, %rcx
	leaq	15(%rax), %rdx
	movq	%rax, -120(%rbp)
	movq	%rdx, %rax
	andq	$-4096, %rdx
	subq	%rdx, %rcx
	andq	$-16, %rax
	cmpq	%rcx, %rsp
	je	.L10
.L85:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L85
.L10:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	jne	.L86
.L11:
	salq	$3, %r12
	movq	%rsp, %rcx
	movq	%rsp, %rbx
	leaq	15(%r12), %rax
	movq	%rax, %rsi
	movq	%rax, %rdx
	andq	$-4096, %rsi
	andq	$-16, %rdx
	subq	%rsi, %rcx
.L12:
	cmpq	%rcx, %rsp
	je	.L13
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L12
.L86:
	orq	$0, -8(%rsp,%rax)
	jmp	.L11
.L84:
	orq	$0, -8(%rsp,%rax)
	jmp	.L4
.L13:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L87
.L14:
	movq	%rax, %rdx
	movq	%rsp, %rcx
	andq	$-4096, %rax
	movq	%rsp, %r13
	andq	$-16, %rdx
	subq	%rax, %rcx
.L15:
	cmpq	%rcx, %rsp
	je	.L16
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L15
.L87:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L14
.L16:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L17
	orq	$0, -8(%rsp,%rax)
.L17:
	cmpq	$0, -104(%rbp)
	movq	-88(%rbp), %rcx
	movq	%rsp, %r14
	js	.L18
	movq	-120(%rbp), %rdx
	xorl	%esi, %esi
	movq	%rbx, %rdi
	movq	%rcx, -128(%rbp)
	call	memset@PLT
	movq	%r12, %rdx
	xorl	%esi, %esi
	movq	%r13, %rdi
	call	memset@PLT
	movq	%r12, %rdx
	xorl	%esi, %esi
	movq	%r14, %rdi
	call	memset@PLT
	movq	-128(%rbp), %rcx
	movq	%r12, %rax
	movq	%rsp, %rdx
	andq	$-4096, %r12
	andq	$-16, %rax
	movl	$1, (%rbx,%rcx,4)
	subq	%r12, %rdx
.L19:
	cmpq	%rdx, %rsp
	je	.L20
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L19
.L20:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L21
	orq	$0, -8(%rsp,%rax)
.L21:
	leaq	7(%rsp), %r12
	movq	%r12, %rax
	andq	$-8, %r12
	shrq	$3, %rax
	cmpq	$0, -112(%rbp)
	movq	%rcx, 0(,%rax,8)
	jle	.L22
.L46:
	movq	%r14, -128(%rbp)
	movq	-112(%rbp), %r14
	xorl	%esi, %esi
	xorl	%r9d, %r9d
	leaq	tree(%rip), %r11
	.p2align 4,,10
	.p2align 3
.L23:
	leaq	1(%rsi), %r10
	cmpq	%rsi, %r9
	jg	.L30
	.p2align 4,,10
	.p2align 3
.L27:
	movq	(%r12,%r9,8), %rdi
	movq	(%r15,%rdi,8), %rax
	testq	%rax, %rax
	jle	.L24
	movq	(%r11,%rdi,8), %rdx
	leaq	(%rdx,%rax,8), %r8
	.p2align 4,,10
	.p2align 3
.L26:
	movq	(%rdx), %rax
	cmpl	$1, (%rbx,%rax,4)
	je	.L25
	movq	0(%r13,%rdi,8), %rcx
	addq	$1, %rsi
	movl	$1, (%rbx,%rax,4)
	movq	%rax, (%r12,%rsi,8)
	addq	$1, %rcx
	movq	%rcx, 0(%r13,%rax,8)
.L25:
	addq	$8, %rdx
	cmpq	%rdx, %r8
	jne	.L26
.L24:
	addq	$1, %r9
	cmpq	%r10, %r9
	jne	.L27
.L30:
	movq	%r10, %r9
	cmpq	%rsi, %r14
	jg	.L23
	cmpq	$0, -104(%rbp)
	movq	-128(%rbp), %r14
	js	.L31
.L22:
	movq	-120(%rbp), %rdx
	xorl	%esi, %esi
	movq	%rbx, %rdi
	call	memset@PLT
	movq	-80(%rbp), %rax
	cmpq	$0, -112(%rbp)
	movl	$1, (%rbx,%rax,4)
	movq	%rax, (%r12)
	jle	.L32
.L47:
	movq	%r13, -120(%rbp)
	movq	-112(%rbp), %r13
	xorl	%esi, %esi
	xorl	%r9d, %r9d
	leaq	tree(%rip), %r11
	.p2align 4,,10
	.p2align 3
.L33:
	leaq	1(%rsi), %r10
	cmpq	%rsi, %r9
	jg	.L39
	.p2align 4,,10
	.p2align 3
.L37:
	movq	(%r12,%r9,8), %rdi
	movq	(%r15,%rdi,8), %rax
	testq	%rax, %rax
	jle	.L34
	movq	(%r11,%rdi,8), %rdx
	leaq	(%rdx,%rax,8), %r8
	.p2align 4,,10
	.p2align 3
.L36:
	movq	(%rdx), %rax
	cmpl	$1, (%rbx,%rax,4)
	je	.L35
	movq	(%r14,%rdi,8), %rcx
	addq	$1, %rsi
	movl	$1, (%rbx,%rax,4)
	movq	%rax, (%r12,%rsi,8)
	addq	$1, %rcx
	movq	%rcx, (%r14,%rax,8)
.L35:
	addq	$8, %rdx
	cmpq	%r8, %rdx
	jne	.L36
.L34:
	addq	$1, %r9
	cmpq	%r9, %r10
	jne	.L37
.L39:
	movq	%r10, %r9
	cmpq	%rsi, %r13
	jg	.L33
	movq	-120(%rbp), %r13
.L32:
	movq	-104(%rbp), %rcx
	testq	%rcx, %rcx
	jle	.L50
	movl	$1, %eax
	xorl	%r8d, %r8d
	jmp	.L42
	.p2align 4,,10
	.p2align 3
.L51:
	movq	%rdx, %rax
.L42:
	movq	(%r14,%rax,8), %rdx
	cmpq	%rdx, 0(%r13,%rax,8)
	jge	.L41
	subq	$1, %rdx
	cmpq	%rdx, %r8
	cmovl	%rdx, %r8
.L41:
	leaq	1(%rax), %rdx
	cmpq	%rcx, %rax
	jne	.L51
.L40:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L88
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L44:
	.cfi_restore_state
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L45
	orq	$0, -8(%rsp,%rax)
.L45:
	leaq	7(%rsp), %r12
	movq	%r12, %rax
	andq	$-8, %r12
	shrq	$3, %rax
	cmpq	$0, -112(%rbp)
	movq	%rcx, 0(,%rax,8)
	jg	.L46
.L50:
	xorl	%r8d, %r8d
	jmp	.L40
.L18:
	movl	$1, (%rbx,%rcx,4)
	movq	%r12, %rax
	movq	%rsp, %rdx
	andq	$-4096, %r12
	andq	$-16, %rax
	subq	%r12, %rdx
.L43:
	cmpq	%rdx, %rsp
	je	.L44
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L43
.L31:
	movq	-80(%rbp), %rax
	movl	$1, (%rbx,%rax,4)
	movq	%rax, (%r12)
	jmp	.L47
.L88:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.globl	tree
	.bss
	.align 32
	.type	tree, @object
	.size	tree, 800008
tree:
	.zero	800008
	.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>

long *tree[100001];

int main(void) {

  long n,u,v;
  scanf("%ld %ld %ld", &n, &u, &v);
  long tree_s[n+1];
  for (long i = 0; i <= n; i++) {
    tree_s[i] = 0;
  }
  long a,b;
  for (long i = 0; i < n-1; i++) {
    scanf("%ld %ld", &a, &b);
    tree[a] = realloc(tree[a], sizeof(long)*(tree_s[a]+1));
    tree[a][tree_s[a]] = b;
    tree_s[a]++;
    tree[b] = realloc(tree[b], sizeof(long)*(tree_s[b]+1));
    tree[b][tree_s[b]] = a;
    tree_s[b]++;
  }
  int visited[n+1];
  long depth_u[n+1],depth_v[n+1];
  for (long i = 0; i <= n; i++) {
    visited[i] = 0;
    depth_u[i] = 0;
    depth_v[i] = 0;
  }
  visited[u] = 1;
  long queue[n];
  queue[0] = u;
  long start = 0, end = 0, tail = 0;
  long cur,next;
  while (tail < n-1) {
    for (long i = start; i <= end; i++) {
      cur = queue[i];
      for (long j = 0; j < tree_s[cur]; j++) {
        next = tree[cur][j];
        if (visited[next] == 1) {
          continue;
        }
        visited[next] = 1;
        depth_u[next] = depth_u[cur]+1;
        tail++;
        queue[tail] = next;
      }
    }
    start = end+1;
    end = tail;
  }
  for (long i = 0; i <= n; i++) {
    visited[i] = 0;
  }
  visited[v] = 1;
  queue[0] = v;
  start = 0; end = 0; tail = 0;
  while (tail < n-1) {
    for (long i = start; i <= end; i++) {
      cur = queue[i];
      for (long j = 0; j < tree_s[cur]; j++) {
        next = tree[cur][j];
        if (visited[next] == 1) {
          continue;
        }
        visited[next] = 1;
        depth_v[next] = depth_v[cur]+1;
        tail++;
        queue[tail] = next;
      }
    }
    start = end+1;
    end = tail;
  }
  long move;
  long max = 0;
  for (long i = 1; i <= n; i++) {
    if (depth_u[i] >= depth_v[i]) {
      continue;
    }
    move = depth_v[i]-1;
    if (move > max) {
      max = move;
    }
  }
  printf("%ld\n", max);

  return 0;
}
5 4 5
1 2
1 3
2 4
1 5
 5 4 1
1 2
1 3
3 4
3 5
 9 6 1
1 2
2 3
3 4
4 5
5 6
4 7
4 8
8 9
 5 4 1
1 2
2 3
1 4
3 5
 9 6 1
1 2
2 4
3 4
4 5
5 6
4 7
4 8
8 9

2
 1
 4
 0
 3

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>

long *tree[100001];

int main(void) {

  long n,u,v;
  scanf("%ld %ld %ld", &n, &u, &v);
  long tree_s[n+1];
  for (long i = 0; i <= n; i++) {
    tree_s[i] = 0;
  }
  long a,b;
  for (long i = 0; i < n-1; i++) {
    scanf("%ld %ld", &a, &b);
    tree[a] = realloc(tree[a], sizeof(long)*(tree_s[a]+1));
    tree[a][tree_s[a]] = b;
    tree_s[a]++;
    tree[b] = realloc(tree[b], sizeof(long)*(tree_s[b]+1));
    tree[b][tree_s[b]] = a;
    tree_s[b]++;
  }
  int visited[n+1];
  long depth_u[n+1],depth_v[n+1];
  for (long i = 0; i <= n; i++) {
    visited[i] = 0;
    depth_u[i] = 0;
    depth_v[i] = 0;
  }
  visited[u] = 1;
  long queue[n];
  queue[0] = u;
  long start = 0, end = 0, tail = 0;
  long cur,next;
  while (tail < n-1) {
    for (long i = start; i <= end; i++) {
      cur = queue[i];
      for (long j = 0; j < tree_s[cur]; j++) {
        next = tree[cur][j];
        if (visited[next] == 1) {
          continue;
        }
        visited[next] = 1;
        depth_u[next] = depth_u[cur]+1;
        tail++;
        queue[tail] = next;
      }
    }
    start = end+1;
    end = tail;
  }
  for (long i = 0; i <= n; i++) {
    visited[i] = 0;
  }
  visited[v] = 1;
  queue[0] = v;
  start = 0; end = 0; tail = 0;
  while (tail < n-1) {
    for (long i = start; i <= end; i++) {
      cur = queue[i];
      for (long j = 0; j < tree_s[cur]; j++) {
        next = tree[cur][j];
        if (visited[next] == 1) {
          continue;
        }
        visited[next] = 1;
        depth_v[next] = depth_v[cur]+1;
        tail++;
        queue[tail] = next;
      }
    }
    start = end+1;
    end = tail;
  }
  long move;
  long max = 0;
  for (long i = 1; i <= n; i++) {
    if (depth_u[i] >= depth_v[i]) {
      continue;
    }
    move = depth_v[i]-1;
    if (move > max) {
      max = move;
    }
  }
  printf("%ld\n", max);

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	tree
	.bss
	.align 32
	.type	tree, @object
	.size	tree, 800008
tree:
	.zero	800008
	.section	.rodata
.LC0:
	.string	"%ld %ld %ld"
.LC1:
	.string	"%ld %ld"
.LC2:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$408, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, -440(%rbp)
	leaq	-288(%rbp), %rcx
	leaq	-296(%rbp), %rdx
	leaq	-304(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-304(%rbp), %rax
	leaq	1(%rax), %rdx
	leaq	-1(%rdx), %rax
	movq	%rax, -160(%rbp)
	movq	%rdx, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	movq	%rdx, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	movq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L2:
	cmpq	%rcx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L4
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -152(%rbp)
	movq	$0, -264(%rbp)
	jmp	.L5
.L6:
	movq	-152(%rbp), %rdx
	movq	-264(%rbp), %rax
	movq	$0, (%rdx,%rax,8)
	addq	$1, -264(%rbp)
.L5:
	movq	-304(%rbp), %rax
	cmpq	%rax, -264(%rbp)
	jle	.L6
	movq	$0, -256(%rbp)
	jmp	.L7
.L8:
	leaq	-272(%rbp), %rdx
	leaq	-280(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-280(%rbp), %rdx
	movq	-152(%rbp), %rax
	movq	(%rax,%rdx,8), %rax
	addq	$1, %rax
	leaq	0(,%rax,8), %rcx
	movq	-280(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	tree(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-280(%rbp), %rbx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	realloc@PLT
	movq	%rax, %rcx
	leaq	0(,%rbx,8), %rdx
	leaq	tree(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movq	-280(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	tree(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movq	-280(%rbp), %rdx
	movq	-152(%rbp), %rax
	movq	(%rax,%rdx,8), %rax
	salq	$3, %rax
	leaq	(%rcx,%rax), %rdx
	movq	-272(%rbp), %rax
	movq	%rax, (%rdx)
	movq	-280(%rbp), %rcx
	movq	-152(%rbp), %rax
	movq	(%rax,%rcx,8), %rax
	leaq	1(%rax), %rdx
	movq	-152(%rbp), %rax
	movq	%rdx, (%rax,%rcx,8)
	movq	-272(%rbp), %rdx
	movq	-152(%rbp), %rax
	movq	(%rax,%rdx,8), %rax
	addq	$1, %rax
	leaq	0(,%rax,8), %rcx
	movq	-272(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	tree(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-272(%rbp), %rbx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	realloc@PLT
	movq	%rax, %rcx
	leaq	0(,%rbx,8), %rdx
	leaq	tree(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movq	-272(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	tree(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movq	-272(%rbp), %rdx
	movq	-152(%rbp), %rax
	movq	(%rax,%rdx,8), %rax
	salq	$3, %rax
	leaq	(%rcx,%rax), %rdx
	movq	-280(%rbp), %rax
	movq	%rax, (%rdx)
	movq	-272(%rbp), %rcx
	movq	-152(%rbp), %rax
	movq	(%rax,%rcx,8), %rax
	leaq	1(%rax), %rdx
	movq	-152(%rbp), %rax
	movq	%rdx, (%rax,%rcx,8)
	addq	$1, -256(%rbp)
.L7:
	movq	-304(%rbp), %rax
	subq	$1, %rax
	cmpq	%rax, -256(%rbp)
	jl	.L8
	movq	-304(%rbp), %rax
	leaq	1(%rax), %rdx
	leaq	-1(%rdx), %rax
	movq	%rax, -144(%rbp)
	movq	%rdx, %rax
	movq	%rax, -320(%rbp)
	movq	$0, -312(%rbp)
	movq	%rdx, %rax
	movq	%rax, -336(%rbp)
	movq	$0, -328(%rbp)
	movq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L9:
	cmpq	%rcx, %rsp
	je	.L10
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L9
.L10:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L11
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L11:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -136(%rbp)
	movq	-304(%rbp), %rax
	addq	$1, %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -128(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -352(%rbp)
	movq	$0, -344(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -368(%rbp)
	movq	$0, -360(%rbp)
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L12:
	cmpq	%rdx, %rsp
	je	.L13
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L12
.L13:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L14
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L14:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -120(%rbp)
	movq	-304(%rbp), %rax
	addq	$1, %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -112(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -384(%rbp)
	movq	$0, -376(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -400(%rbp)
	movq	$0, -392(%rbp)
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L15:
	cmpq	%rdx, %rsp
	je	.L16
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L15
.L16:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L17
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L17:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -104(%rbp)
	movq	$0, -248(%rbp)
	jmp	.L18
.L19:
	movq	-136(%rbp), %rax
	movq	-248(%rbp), %rdx
	movl	$0, (%rax,%rdx,4)
	movq	-120(%rbp), %rax
	movq	-248(%rbp), %rdx
	movq	$0, (%rax,%rdx,8)
	movq	-104(%rbp), %rax
	movq	-248(%rbp), %rdx
	movq	$0, (%rax,%rdx,8)
	addq	$1, -248(%rbp)
.L18:
	movq	-304(%rbp), %rax
	cmpq	%rax, -248(%rbp)
	jle	.L19
	movq	-296(%rbp), %rdx
	movq	-136(%rbp), %rax
	movl	$1, (%rax,%rdx,4)
	movq	-304(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -96(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -416(%rbp)
	movq	$0, -408(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -432(%rbp)
	movq	$0, -424(%rbp)
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L20:
	cmpq	%rdx, %rsp
	je	.L21
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L20
.L21:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L22
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L22:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -88(%rbp)
	movq	-296(%rbp), %rdx
	movq	-88(%rbp), %rax
	movq	%rdx, (%rax)
	movq	$0, -240(%rbp)
	movq	$0, -232(%rbp)
	movq	$0, -224(%rbp)
	jmp	.L23
.L30:
	movq	-240(%rbp), %rax
	movq	%rax, -216(%rbp)
	jmp	.L24
.L29:
	movq	-88(%rbp), %rax
	movq	-216(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, -72(%rbp)
	movq	$0, -208(%rbp)
	jmp	.L25
.L28:
	movq	-72(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	tree(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-208(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -64(%rbp)
	movq	-136(%rbp), %rax
	movq	-64(%rbp), %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	$1, %eax
	je	.L47
	movq	-136(%rbp), %rax
	movq	-64(%rbp), %rdx
	movl	$1, (%rax,%rdx,4)
	movq	-120(%rbp), %rax
	movq	-72(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	leaq	1(%rax), %rcx
	movq	-120(%rbp), %rax
	movq	-64(%rbp), %rdx
	movq	%rcx, (%rax,%rdx,8)
	addq	$1, -224(%rbp)
	movq	-88(%rbp), %rax
	movq	-224(%rbp), %rdx
	movq	-64(%rbp), %rcx
	movq	%rcx, (%rax,%rdx,8)
	jmp	.L27
.L47:
	nop
.L27:
	addq	$1, -208(%rbp)
.L25:
	movq	-152(%rbp), %rax
	movq	-72(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	cmpq	%rax, -208(%rbp)
	jl	.L28
	addq	$1, -216(%rbp)
.L24:
	movq	-216(%rbp), %rax
	cmpq	-232(%rbp), %rax
	jle	.L29
	movq	-232(%rbp), %rax
	addq	$1, %rax
	movq	%rax, -240(%rbp)
	movq	-224(%rbp), %rax
	movq	%rax, -232(%rbp)
.L23:
	movq	-304(%rbp), %rax
	subq	$1, %rax
	cmpq	%rax, -224(%rbp)
	jl	.L30
	movq	$0, -200(%rbp)
	jmp	.L31
.L32:
	movq	-136(%rbp), %rax
	movq	-200(%rbp), %rdx
	movl	$0, (%rax,%rdx,4)
	addq	$1, -200(%rbp)
.L31:
	movq	-304(%rbp), %rax
	cmpq	%rax, -200(%rbp)
	jle	.L32
	movq	-288(%rbp), %rdx
	movq	-136(%rbp), %rax
	movl	$1, (%rax,%rdx,4)
	movq	-288(%rbp), %rdx
	movq	-88(%rbp), %rax
	movq	%rdx, (%rax)
	movq	$0, -240(%rbp)
	movq	$0, -232(%rbp)
	movq	$0, -224(%rbp)
	jmp	.L33
.L40:
	movq	-240(%rbp), %rax
	movq	%rax, -192(%rbp)
	jmp	.L34
.L39:
	movq	-88(%rbp), %rax
	movq	-192(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, -72(%rbp)
	movq	$0, -184(%rbp)
	jmp	.L35
.L38:
	movq	-72(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	tree(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-184(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -64(%rbp)
	movq	-136(%rbp), %rax
	movq	-64(%rbp), %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	$1, %eax
	je	.L48
	movq	-136(%rbp), %rax
	movq	-64(%rbp), %rdx
	movl	$1, (%rax,%rdx,4)
	movq	-104(%rbp), %rax
	movq	-72(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	leaq	1(%rax), %rcx
	movq	-104(%rbp), %rax
	movq	-64(%rbp), %rdx
	movq	%rcx, (%rax,%rdx,8)
	addq	$1, -224(%rbp)
	movq	-88(%rbp), %rax
	movq	-224(%rbp), %rdx
	movq	-64(%rbp), %rcx
	movq	%rcx, (%rax,%rdx,8)
	jmp	.L37
.L48:
	nop
.L37:
	addq	$1, -184(%rbp)
.L35:
	movq	-152(%rbp), %rax
	movq	-72(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	cmpq	%rax, -184(%rbp)
	jl	.L38
	addq	$1, -192(%rbp)
.L34:
	movq	-192(%rbp), %rax
	cmpq	-232(%rbp), %rax
	jle	.L39
	movq	-232(%rbp), %rax
	addq	$1, %rax
	movq	%rax, -240(%rbp)
	movq	-224(%rbp), %rax
	movq	%rax, -232(%rbp)
.L33:
	movq	-304(%rbp), %rax
	subq	$1, %rax
	cmpq	%rax, -224(%rbp)
	jl	.L40
	movq	$0, -176(%rbp)
	movq	$1, -168(%rbp)
	jmp	.L41
.L44:
	movq	-120(%rbp), %rax
	movq	-168(%rbp), %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-104(%rbp), %rax
	movq	-168(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	cmpq	%rax, %rcx
	jge	.L49
	movq	-104(%rbp), %rax
	movq	-168(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	subq	$1, %rax
	movq	%rax, -80(%rbp)
	movq	-80(%rbp), %rax
	cmpq	-176(%rbp), %rax
	jle	.L43
	movq	-80(%rbp), %rax
	movq	%rax, -176(%rbp)
	jmp	.L43
.L49:
	nop
.L43:
	addq	$1, -168(%rbp)
.L41:
	movq	-304(%rbp), %rax
	cmpq	%rax, -168(%rbp)
	jle	.L44
	movq	-176(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-440(%rbp), %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L46
	call	__stack_chk_fail@PLT
.L46:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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	tree
	.bss
	.align 32
	.type	tree, @object
	.size	tree, 800008
tree:
	.zero	800008
	.section	.rodata
.LC0:
	.string	"%ld %ld %ld"
.LC1:
	.string	"%ld %ld"
.LC2:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$408, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, -440(%rbp)
	leaq	-288(%rbp), %rcx
	leaq	-296(%rbp), %rdx
	leaq	-304(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-304(%rbp), %rax
	leaq	1(%rax), %rdx
	leaq	-1(%rdx), %rax
	movq	%rax, -160(%rbp)
	movq	%rdx, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	movq	%rdx, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	movq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L2:
	cmpq	%rcx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L4
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -152(%rbp)
	movq	$0, -264(%rbp)
	jmp	.L5
.L6:
	movq	-152(%rbp), %rdx
	movq	-264(%rbp), %rax
	movq	$0, (%rdx,%rax,8)
	addq	$1, -264(%rbp)
.L5:
	movq	-304(%rbp), %rax
	cmpq	%rax, -264(%rbp)
	jle	.L6
	movq	$0, -256(%rbp)
	jmp	.L7
.L8:
	leaq	-272(%rbp), %rdx
	leaq	-280(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-280(%rbp), %rdx
	movq	-152(%rbp), %rax
	movq	(%rax,%rdx,8), %rax
	addq	$1, %rax
	leaq	0(,%rax,8), %rcx
	movq	-280(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	tree(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-280(%rbp), %rbx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	realloc@PLT
	movq	%rax, %rcx
	leaq	0(,%rbx,8), %rdx
	leaq	tree(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movq	-280(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	tree(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movq	-280(%rbp), %rdx
	movq	-152(%rbp), %rax
	movq	(%rax,%rdx,8), %rax
	salq	$3, %rax
	leaq	(%rcx,%rax), %rdx
	movq	-272(%rbp), %rax
	movq	%rax, (%rdx)
	movq	-280(%rbp), %rcx
	movq	-152(%rbp), %rax
	movq	(%rax,%rcx,8), %rax
	leaq	1(%rax), %rdx
	movq	-152(%rbp), %rax
	movq	%rdx, (%rax,%rcx,8)
	movq	-272(%rbp), %rdx
	movq	-152(%rbp), %rax
	movq	(%rax,%rdx,8), %rax
	addq	$1, %rax
	leaq	0(,%rax,8), %rcx
	movq	-272(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	tree(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-272(%rbp), %rbx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	realloc@PLT
	movq	%rax, %rcx
	leaq	0(,%rbx,8), %rdx
	leaq	tree(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movq	-272(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	tree(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movq	-272(%rbp), %rdx
	movq	-152(%rbp), %rax
	movq	(%rax,%rdx,8), %rax
	salq	$3, %rax
	leaq	(%rcx,%rax), %rdx
	movq	-280(%rbp), %rax
	movq	%rax, (%rdx)
	movq	-272(%rbp), %rcx
	movq	-152(%rbp), %rax
	movq	(%rax,%rcx,8), %rax
	leaq	1(%rax), %rdx
	movq	-152(%rbp), %rax
	movq	%rdx, (%rax,%rcx,8)
	addq	$1, -256(%rbp)
.L7:
	movq	-304(%rbp), %rax
	subq	$1, %rax
	cmpq	%rax, -256(%rbp)
	jl	.L8
	movq	-304(%rbp), %rax
	leaq	1(%rax), %rdx
	leaq	-1(%rdx), %rax
	movq	%rax, -144(%rbp)
	movq	%rdx, %rax
	movq	%rax, -320(%rbp)
	movq	$0, -312(%rbp)
	movq	%rdx, %rax
	movq	%rax, -336(%rbp)
	movq	$0, -328(%rbp)
	movq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L9:
	cmpq	%rcx, %rsp
	je	.L10
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L9
.L10:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L11
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L11:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -136(%rbp)
	movq	-304(%rbp), %rax
	addq	$1, %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -128(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -352(%rbp)
	movq	$0, -344(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -368(%rbp)
	movq	$0, -360(%rbp)
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L12:
	cmpq	%rdx, %rsp
	je	.L13
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L12
.L13:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L14
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L14:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -120(%rbp)
	movq	-304(%rbp), %rax
	addq	$1, %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -112(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -384(%rbp)
	movq	$0, -376(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -400(%rbp)
	movq	$0, -392(%rbp)
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L15:
	cmpq	%rdx, %rsp
	je	.L16
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L15
.L16:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L17
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L17:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -104(%rbp)
	movq	$0, -248(%rbp)
	jmp	.L18
.L19:
	movq	-136(%rbp), %rax
	movq	-248(%rbp), %rdx
	movl	$0, (%rax,%rdx,4)
	movq	-120(%rbp), %rax
	movq	-248(%rbp), %rdx
	movq	$0, (%rax,%rdx,8)
	movq	-104(%rbp), %rax
	movq	-248(%rbp), %rdx
	movq	$0, (%rax,%rdx,8)
	addq	$1, -248(%rbp)
.L18:
	movq	-304(%rbp), %rax
	cmpq	%rax, -248(%rbp)
	jle	.L19
	movq	-296(%rbp), %rdx
	movq	-136(%rbp), %rax
	movl	$1, (%rax,%rdx,4)
	movq	-304(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -96(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -416(%rbp)
	movq	$0, -408(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -432(%rbp)
	movq	$0, -424(%rbp)
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L20:
	cmpq	%rdx, %rsp
	je	.L21
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L20
.L21:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L22
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L22:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -88(%rbp)
	movq	-296(%rbp), %rdx
	movq	-88(%rbp), %rax
	movq	%rdx, (%rax)
	movq	$0, -240(%rbp)
	movq	$0, -232(%rbp)
	movq	$0, -224(%rbp)
	jmp	.L23
.L30:
	movq	-240(%rbp), %rax
	movq	%rax, -216(%rbp)
	jmp	.L24
.L29:
	movq	-88(%rbp), %rax
	movq	-216(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, -72(%rbp)
	movq	$0, -208(%rbp)
	jmp	.L25
.L28:
	movq	-72(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	tree(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-208(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -64(%rbp)
	movq	-136(%rbp), %rax
	movq	-64(%rbp), %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	$1, %eax
	je	.L47
	movq	-136(%rbp), %rax
	movq	-64(%rbp), %rdx
	movl	$1, (%rax,%rdx,4)
	movq	-120(%rbp), %rax
	movq	-72(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	leaq	1(%rax), %rcx
	movq	-120(%rbp), %rax
	movq	-64(%rbp), %rdx
	movq	%rcx, (%rax,%rdx,8)
	addq	$1, -224(%rbp)
	movq	-88(%rbp), %rax
	movq	-224(%rbp), %rdx
	movq	-64(%rbp), %rcx
	movq	%rcx, (%rax,%rdx,8)
	jmp	.L27
.L47:
	nop
.L27:
	addq	$1, -208(%rbp)
.L25:
	movq	-152(%rbp), %rax
	movq	-72(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	cmpq	%rax, -208(%rbp)
	jl	.L28
	addq	$1, -216(%rbp)
.L24:
	movq	-216(%rbp), %rax
	cmpq	-232(%rbp), %rax
	jle	.L29
	movq	-232(%rbp), %rax
	addq	$1, %rax
	movq	%rax, -240(%rbp)
	movq	-224(%rbp), %rax
	movq	%rax, -232(%rbp)
.L23:
	movq	-304(%rbp), %rax
	subq	$1, %rax
	cmpq	%rax, -224(%rbp)
	jl	.L30
	movq	$0, -200(%rbp)
	jmp	.L31
.L32:
	movq	-136(%rbp), %rax
	movq	-200(%rbp), %rdx
	movl	$0, (%rax,%rdx,4)
	addq	$1, -200(%rbp)
.L31:
	movq	-304(%rbp), %rax
	cmpq	%rax, -200(%rbp)
	jle	.L32
	movq	-288(%rbp), %rdx
	movq	-136(%rbp), %rax
	movl	$1, (%rax,%rdx,4)
	movq	-288(%rbp), %rdx
	movq	-88(%rbp), %rax
	movq	%rdx, (%rax)
	movq	$0, -240(%rbp)
	movq	$0, -232(%rbp)
	movq	$0, -224(%rbp)
	jmp	.L33
.L40:
	movq	-240(%rbp), %rax
	movq	%rax, -192(%rbp)
	jmp	.L34
.L39:
	movq	-88(%rbp), %rax
	movq	-192(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, -72(%rbp)
	movq	$0, -184(%rbp)
	jmp	.L35
.L38:
	movq	-72(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	tree(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-184(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -64(%rbp)
	movq	-136(%rbp), %rax
	movq	-64(%rbp), %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	$1, %eax
	je	.L48
	movq	-136(%rbp), %rax
	movq	-64(%rbp), %rdx
	movl	$1, (%rax,%rdx,4)
	movq	-104(%rbp), %rax
	movq	-72(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	leaq	1(%rax), %rcx
	movq	-104(%rbp), %rax
	movq	-64(%rbp), %rdx
	movq	%rcx, (%rax,%rdx,8)
	addq	$1, -224(%rbp)
	movq	-88(%rbp), %rax
	movq	-224(%rbp), %rdx
	movq	-64(%rbp), %rcx
	movq	%rcx, (%rax,%rdx,8)
	jmp	.L37
.L48:
	nop
.L37:
	addq	$1, -184(%rbp)
.L35:
	movq	-152(%rbp), %rax
	movq	-72(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	cmpq	%rax, -184(%rbp)
	jl	.L38
	addq	$1, -192(%rbp)
.L34:
	movq	-192(%rbp), %rax
	cmpq	-232(%rbp), %rax
	jle	.L39
	movq	-232(%rbp), %rax
	addq	$1, %rax
	movq	%rax, -240(%rbp)
	movq	-224(%rbp), %rax
	movq	%rax, -232(%rbp)
.L33:
	movq	-304(%rbp), %rax
	subq	$1, %rax
	cmpq	%rax, -224(%rbp)
	jl	.L40
	movq	$0, -176(%rbp)
	movq	$1, -168(%rbp)
	jmp	.L41
.L44:
	movq	-120(%rbp), %rax
	movq	-168(%rbp), %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-104(%rbp), %rax
	movq	-168(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	cmpq	%rax, %rcx
	jge	.L49
	movq	-104(%rbp), %rax
	movq	-168(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	subq	$1, %rax
	movq	%rax, -80(%rbp)
	movq	-80(%rbp), %rax
	cmpq	-176(%rbp), %rax
	jle	.L43
	movq	-80(%rbp), %rax
	movq	%rax, -176(%rbp)
	jmp	.L43
.L49:
	nop
.L43:
	addq	$1, -168(%rbp)
.L41:
	movq	-304(%rbp), %rax
	cmpq	%rax, -168(%rbp)
	jle	.L44
	movq	-176(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-440(%rbp), %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L46
	call	__stack_chk_fail@PLT
.L46:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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:
