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

```c
#include<stdio.h>
#define MAX 100005

int parent[MAX], left[MAX], right[MAX];
int n, D[MAX];

int getDepth(int u){
  int d = 0;
  while(parent[u] != -1){
    u = parent[u];
    d++;
  }
  return d;
}
void setDepth(int u, int p){
  D[u] = p;
  if(right[u] != -1){
    setDepth(right[u], p);
  }
  if(left[u] != -1){
    setDepth(left[u], p+1 );
  }
}

void printChildren(int u){

  int i, c;

  printf("node %d: ", u);
  printf("parent = %d, ", parent[u]);
  printf("depth = %d, ", getDepth(u));

  if(parent[u] == -1 ) printf("root, ");
  else if(left[u] == -1 ) printf("leaf, ");
  else printf("internal node, ");

  printf("[");

  for( i = 0, c = left[u] ; c != -1 ; i++, c = right[c]){
    if(i) printf(", ");
    printf("%d", c);
  }
  printf("]\n");
}

int main(){
  int i, j, d, v, c, l, r;
  scanf("%d", &n);
  for(i = 0 ; i < n ; i++)  parent[i] = left[i] = right[i] = -1;

  for( i = 0 ; i < n ; i++){
    scanf("%d", &v);
    scanf("%d", &d);
    for( j = 0 ; j < d ; j++){
      scanf("%d", &c);
      if( j == 0 ) left[v] = c;
      else right[l] = c;
      l = c;
      parent[c] = v;
    }
  }
  for( i = 0 ; i < n ; i++){
    if( parent[i] == -1 ) r = i;
  }

  setDepth(r, 0);

  for( i = 0 ; i < n ; i++) printChildren(i);

  return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	parent
	.bss
	.align 32
	.type	parent, @object
	.size	parent, 400020
parent:
	.zero	400020
	.globl	left
	.align 32
	.type	left, @object
	.size	left, 400020
left:
	.zero	400020
	.globl	right
	.align 32
	.type	right, @object
	.size	right, 400020
right:
	.zero	400020
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	D
	.align 32
	.type	D, @object
	.size	D, 400020
D:
	.zero	400020
	.text
	.globl	getDepth
	.type	getDepth, @function
getDepth:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L2
.L3:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	parent(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -20(%rbp)
	addl	$1, -4(%rbp)
.L2:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	parent(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	jne	.L3
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	getDepth, .-getDepth
	.globl	setDepth
	.type	setDepth, @function
setDepth:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	D(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	right(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L6
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	right(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-8(%rbp), %edx
	movl	%edx, %esi
	movl	%eax, %edi
	call	setDepth
.L6:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	left(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L8
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	left(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	setDepth
.L8:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	setDepth, .-setDepth
	.section	.rodata
.LC0:
	.string	"node %d: "
.LC1:
	.string	"parent = %d, "
.LC2:
	.string	"depth = %d, "
.LC3:
	.string	"root, "
.LC4:
	.string	"leaf, "
.LC5:
	.string	"internal node, "
.LC6:
	.string	", "
.LC7:
	.string	"%d"
.LC8:
	.string	"]"
	.text
	.globl	printChildren
	.type	printChildren, @function
printChildren:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	parent(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	getDepth
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	parent(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	jne	.L10
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L11
.L10:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	left(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	jne	.L12
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L11
.L12:
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L11:
	movl	$91, %edi
	call	putchar@PLT
	movl	$0, -8(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	left(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	jmp	.L13
.L15:
	cmpl	$0, -8(%rbp)
	je	.L14
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L14:
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC7(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -8(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	right(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
.L13:
	cmpl	$-1, -4(%rbp)
	jne	.L15
	leaq	.LC8(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	printChildren, .-printChildren
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC7(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -24(%rbp)
	jmp	.L17
.L18:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	right(%rip), %rax
	movl	$-1, (%rdx,%rax)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	right(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	left(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	left(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	parent(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -24(%rbp)
.L17:
	movl	n(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L18
	movl	$0, -24(%rbp)
	jmp	.L19
.L24:
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC7(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC7(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -20(%rbp)
	jmp	.L20
.L23:
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC7(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$0, -20(%rbp)
	jne	.L21
	movl	-32(%rbp), %edx
	movl	-28(%rbp), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	left(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	jmp	.L22
.L21:
	movl	-28(%rbp), %eax
	movl	-16(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	right(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L22:
	movl	-28(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	-28(%rbp), %edx
	movl	-32(%rbp), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	parent(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L20:
	movl	-36(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L23
	addl	$1, -24(%rbp)
.L19:
	movl	n(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L24
	movl	$0, -24(%rbp)
	jmp	.L25
.L27:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	parent(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	jne	.L26
	movl	-24(%rbp), %eax
	movl	%eax, -12(%rbp)
.L26:
	addl	$1, -24(%rbp)
.L25:
	movl	n(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L27
	movl	-12(%rbp), %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	setDepth
	movl	$0, -24(%rbp)
	jmp	.L28
.L29:
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	call	printChildren
	addl	$1, -24(%rbp)
.L28:
	movl	n(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L29
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	getDepth
	.type	getDepth, @function
getDepth:
.LFB23:
	.cfi_startproc
	endbr64
	leaq	parent(%rip), %rdx
	movslq	%edi, %rdi
	xorl	%r8d, %r8d
	movslq	(%rdx,%rdi,4), %rax
	cmpl	$-1, %eax
	je	.L1
	.p2align 4,,10
	.p2align 3
.L3:
	movslq	(%rdx,%rax,4), %rax
	addl	$1, %r8d
	cmpl	$-1, %eax
	jne	.L3
.L1:
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	getDepth, .-getDepth
	.p2align 4
	.globl	setDepth
	.type	setDepth, @function
setDepth:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%edi, %rax
	leaq	D(%rip), %r9
	leaq	right(%rip), %r10
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	left(%rip), %r11
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	movl	%esi, 48(%rsp)
.L27:
	movl	48(%rsp), %edi
	movq	%rax, 40(%rsp)
	movl	%edi, (%r9,%rax,4)
	movslq	(%r10,%rax,4), %rax
	cmpl	$-1, %eax
	je	.L8
	movl	%edi, 28(%rsp)
.L25:
	movl	28(%rsp), %esi
	movq	%rax, 32(%rsp)
	movl	%esi, (%r9,%rax,4)
	movslq	(%r10,%rax,4), %rax
	cmpl	$-1, %eax
	je	.L9
	movl	%esi, 24(%rsp)
.L24:
	movl	24(%rsp), %edi
	movl	(%r10,%rax,4), %ecx
	movq	%rax, 16(%rsp)
	movl	%edi, (%r9,%rax,4)
	cmpl	$-1, %ecx
	je	.L10
	movl	%edi, 12(%rsp)
.L23:
	movslq	%ecx, %r8
	movl	12(%rsp), %ecx
	movslq	(%r10,%r8,4), %rax
	movl	%ecx, (%r9,%r8,4)
	cmpl	$-1, %eax
	jne	.L22
.L11:
	movl	(%r11,%r8,4), %ecx
	cmpl	$-1, %ecx
	je	.L10
	addl	$1, 12(%rsp)
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L12:
	movslq	(%r11,%rax,4), %rax
	cmpl	$-1, %eax
	je	.L11
	addl	$1, %ecx
.L22:
	movl	(%r10,%rax,4), %r12d
	movl	%ecx, (%r9,%rax,4)
	cmpl	$-1, %r12d
	je	.L12
	movl	%ecx, %r15d
.L21:
	movslq	%r12d, %r13
	movslq	(%r10,%r13,4), %rbx
	movl	%r15d, (%r9,%r13,4)
	cmpl	$-1, %ebx
	je	.L13
	movl	%r15d, %r12d
.L20:
	movslq	(%r10,%rbx,4), %r14
	movl	%r12d, (%r9,%rbx,4)
	cmpl	$-1, %r14d
	je	.L14
	movl	%r12d, %edx
.L19:
	movslq	(%r10,%r14,4), %rbp
	movl	%edx, (%r9,%r14,4)
	cmpl	$-1, %ebp
	je	.L15
	movl	(%r10,%rbp,4), %edi
	movl	%edx, %esi
	movl	%esi, (%r9,%rbp,4)
	cmpl	$-1, %edi
	je	.L16
.L82:
	movq	%rax, 72(%rsp)
	movq	%r8, 64(%rsp)
	movl	%edx, 60(%rsp)
	movl	%ecx, 56(%rsp)
	movl	%esi, 52(%rsp)
	call	setDepth
	leaq	left(%rip), %r11
	movl	52(%rsp), %esi
	movl	56(%rsp), %ecx
	movslq	(%r11,%rbp,4), %rbp
	movl	60(%rsp), %edx
	leaq	D(%rip), %r9
	leaq	right(%rip), %r10
	movq	64(%rsp), %r8
	movq	72(%rsp), %rax
	cmpl	$-1, %ebp
	je	.L15
	.p2align 4,,10
	.p2align 3
.L17:
	movl	(%r10,%rbp,4), %edi
	addl	$1, %esi
	movl	%esi, (%r9,%rbp,4)
	cmpl	$-1, %edi
	jne	.L82
.L16:
	movslq	(%r11,%rbp,4), %rbp
	cmpl	$-1, %ebp
	jne	.L17
.L15:
	movslq	(%r11,%r14,4), %r14
	cmpl	$-1, %r14d
	je	.L14
	addl	$1, %edx
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L14:
	movslq	(%r11,%rbx,4), %rbx
	cmpl	$-1, %ebx
	je	.L13
	addl	$1, %r12d
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L13:
	movl	(%r11,%r13,4), %r12d
	cmpl	$-1, %r12d
	je	.L12
	addl	$1, %r15d
	jmp	.L21
.L10:
	movq	16(%rsp), %rax
	movslq	(%r11,%rax,4), %rax
	cmpl	$-1, %eax
	je	.L9
	addl	$1, 24(%rsp)
	jmp	.L24
.L9:
	movq	32(%rsp), %rax
	movslq	(%r11,%rax,4), %rax
	cmpl	$-1, %eax
	je	.L8
	addl	$1, 28(%rsp)
	jmp	.L25
.L8:
	movq	40(%rsp), %rax
	movslq	(%r11,%rax,4), %rax
	cmpl	$-1, %eax
	je	.L7
	addl	$1, 48(%rsp)
	jmp	.L27
.L7:
	addq	$88, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE24:
	.size	setDepth, .-setDepth
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"node %d: "
.LC1:
	.string	"parent = %d, "
.LC2:
	.string	"depth = %d, "
.LC3:
	.string	"root, "
.LC4:
	.string	"leaf, "
.LC5:
	.string	"internal node, "
.LC6:
	.string	"]"
.LC7:
	.string	", "
.LC8:
	.string	"%d"
	.text
	.p2align 4
	.globl	printChildren
	.type	printChildren, @function
printChildren:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rsi
	xorl	%eax, %eax
	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
	movl	%ebp, %edx
	leaq	parent(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	call	__printf_chk@PLT
	movl	(%rbx,%rbp,4), %edx
	movl	$1, %edi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movslq	(%rbx,%rbp,4), %rax
	xorl	%edx, %edx
	cmpl	$-1, %eax
	je	.L84
	.p2align 4,,10
	.p2align 3
.L85:
	movslq	(%rbx,%rax,4), %rax
	addl	$1, %edx
	cmpl	$-1, %eax
	jne	.L85
.L84:
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	cmpl	$-1, (%rbx,%rbp,4)
	je	.L97
	leaq	left(%rip), %rbx
	cmpl	$-1, (%rbx,%rbp,4)
	je	.L98
	leaq	.LC5(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L87:
	movl	$91, %edi
	leaq	.LC8(%rip), %r12
	leaq	.LC7(%rip), %r13
	call	putchar@PLT
	movslq	(%rbx,%rbp,4), %rbx
	leaq	right(%rip), %rbp
	cmpl	$-1, %ebx
	jne	.L89
	jmp	.L91
	.p2align 4,,10
	.p2align 3
.L90:
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L89:
	movl	%ebx, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movslq	0(%rbp,%rbx,4), %rbx
	cmpl	$-1, %ebx
	jne	.L90
.L91:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	leaq	.LC6(%rip), %rdi
	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
	jmp	puts@PLT
	.p2align 4,,10
	.p2align 3
.L98:
	.cfi_restore_state
	leaq	.LC4(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L87
	.p2align 4,,10
	.p2align 3
.L97:
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	left(%rip), %rbx
	jmp	.L87
	.cfi_endproc
.LFE25:
	.size	printChildren, .-printChildren
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB26:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	n(%rip), %rsi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC8(%rip), %rbx
	movq	%rbx, %rdi
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	n(%rip), %rax
	testl	%eax, %eax
	jle	.L101
	leaq	0(,%rax,4), %r12
	movl	$255, %esi
	leaq	right(%rip), %rdi
	movq	%r12, %rdx
	leaq	parent(%rip), %rbp
	call	memset@PLT
	movq	%r12, %rdx
	movl	$255, %esi
	leaq	left(%rip), %rdi
	call	memset@PLT
	movq	%r12, %rdx
	movl	$255, %esi
	movq	%rbp, %rdi
	call	memset@PLT
	leaq	48(%rsp), %rax
	leaq	52(%rsp), %r12
	movl	$0, 24(%rsp)
	movq	%rax, 16(%rsp)
	leaq	44(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L105:
	movq	16(%rsp), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %edx
	testl	%edx, %edx
	jle	.L102
	xorl	%r13d, %r13d
	jmp	.L104
	.p2align 4,,10
	.p2align 3
.L127:
	movslq	48(%rsp), %rdx
	movslq	52(%rsp), %r14
	leaq	left(%rip), %rdi
	cmpl	$1, 44(%rsp)
	movl	%r14d, (%rdi,%rdx,4)
	movl	%edx, 0(%rbp,%r14,4)
	jle	.L117
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	movl	$1, %r13d
	call	__isoc99_scanf@PLT
.L103:
	movl	52(%rsp), %r15d
	leaq	right(%rip), %rax
	movl	48(%rsp), %esi
	addl	$1, %r13d
	movl	%r15d, (%rax,%r14,4)
	movslq	%r15d, %rax
	movl	%esi, 0(%rbp,%rax,4)
	cmpl	%r13d, 44(%rsp)
	jle	.L102
.L104:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	testl	%r13d, %r13d
	je	.L127
	movslq	%r15d, %r14
	jmp	.L103
	.p2align 4,,10
	.p2align 3
.L117:
	movl	%r14d, %r15d
.L102:
	addl	$1, 24(%rsp)
	movl	n(%rip), %eax
	movl	24(%rsp), %edx
	cmpl	%edx, %eax
	jg	.L105
	testl	%eax, %eax
	jle	.L101
	leal	-1(%rax), %edx
	cmpl	$2, %edx
	jbe	.L118
	movl	%eax, %ecx
	leaq	parent(%rip), %rdx
	pcmpeqd	%xmm3, %xmm3
	movdqa	.LC9(%rip), %xmm2
	shrl	$2, %ecx
	leaq	16(%rdx), %rsi
	movdqa	.LC10(%rip), %xmm5
	movdqa	%xmm3, %xmm4
	subl	$1, %ecx
	salq	$4, %rcx
	addq	%rsi, %rcx
	.p2align 4,,10
	.p2align 3
.L108:
	movdqa	%xmm4, %xmm0
	movdqa	%xmm2, %xmm1
	paddd	%xmm5, %xmm2
	addq	$16, %rdx
	pcmpeqd	-16(%rdx), %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm3, %xmm0
	movdqa	%xmm0, %xmm3
	por	%xmm1, %xmm3
	cmpq	%rcx, %rdx
	jne	.L108
	movdqa	%xmm3, %xmm0
	movl	$0, %ebx
	psrldq	$8, %xmm0
	movdqa	%xmm0, %xmm1
	pcmpgtd	%xmm3, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm3, %xmm1
	por	%xmm0, %xmm1
	movdqa	%xmm1, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm0
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm2
	pandn	%xmm1, %xmm0
	por	%xmm2, %xmm0
	movd	%xmm0, %edx
	cmpl	$-1, %edx
	cmove	%ebx, %edx
	movl	%edx, 28(%rsp)
	movl	%eax, %edx
	andl	$-4, %edx
	testb	$3, %al
	je	.L101
.L107:
	movl	28(%rsp), %ebx
	movslq	%edx, %rcx
	cmpl	$-1, 0(%rbp,%rcx,4)
	leal	1(%rdx), %ecx
	cmove	%edx, %ebx
	movl	%ebx, 28(%rsp)
	cmpl	%ecx, %eax
	jle	.L101
	movslq	%ecx, %rsi
	cmpl	$-1, 0(%rbp,%rsi,4)
	cmovne	%ebx, %ecx
	addl	$2, %edx
	movl	%ecx, 28(%rsp)
	cmpl	%edx, %eax
	jle	.L101
	movslq	%edx, %rax
	cmpl	$-1, 0(%rbp,%rax,4)
	cmovne	%ecx, %edx
	movl	%edx, 28(%rsp)
.L101:
	movl	28(%rsp), %edi
	xorl	%esi, %esi
	xorl	%ebx, %ebx
	call	setDepth
	movl	n(%rip), %eax
	testl	%eax, %eax
	jle	.L114
	.p2align 4,,10
	.p2align 3
.L113:
	movl	%ebx, %edi
	addl	$1, %ebx
	call	printChildren
	cmpl	%ebx, n(%rip)
	jg	.L113
.L114:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L128
	addq	$72, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L118:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L107
.L128:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE26:
	.size	main, .-main
	.globl	D
	.bss
	.align 32
	.type	D, @object
	.size	D, 400020
D:
	.zero	400020
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	right
	.align 32
	.type	right, @object
	.size	right, 400020
right:
	.zero	400020
	.globl	left
	.align 32
	.type	left, @object
	.size	left, 400020
left:
	.zero	400020
	.globl	parent
	.align 32
	.type	parent, @object
	.size	parent, 400020
parent:
	.zero	400020
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC9:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC10:
	.long	4
	.long	4
	.long	4
	.long	4
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	getDepth
	.type	getDepth, @function
getDepth:
.LFB23:
	.cfi_startproc
	endbr64
	leaq	parent(%rip), %rdx
	movslq	%edi, %rdi
	xorl	%r8d, %r8d
	movslq	(%rdx,%rdi,4), %rax
	cmpl	$-1, %eax
	je	.L1
	.p2align 4,,10
	.p2align 3
.L3:
	movslq	(%rdx,%rax,4), %rax
	addl	$1, %r8d
	cmpl	$-1, %eax
	jne	.L3
.L1:
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	getDepth, .-getDepth
	.p2align 4
	.globl	setDepth
	.type	setDepth, @function
setDepth:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%edi, %rax
	leaq	D(%rip), %r9
	leaq	right(%rip), %r10
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	left(%rip), %r11
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	movl	%esi, 48(%rsp)
.L27:
	movl	48(%rsp), %edi
	movq	%rax, 40(%rsp)
	movl	%edi, (%r9,%rax,4)
	movslq	(%r10,%rax,4), %rax
	cmpl	$-1, %eax
	je	.L8
	movl	%edi, 28(%rsp)
.L25:
	movl	28(%rsp), %esi
	movq	%rax, 32(%rsp)
	movl	%esi, (%r9,%rax,4)
	movslq	(%r10,%rax,4), %rax
	cmpl	$-1, %eax
	je	.L9
	movl	%esi, 24(%rsp)
.L24:
	movl	24(%rsp), %edi
	movl	(%r10,%rax,4), %ecx
	movq	%rax, 16(%rsp)
	movl	%edi, (%r9,%rax,4)
	cmpl	$-1, %ecx
	je	.L10
	movl	%edi, 12(%rsp)
.L23:
	movslq	%ecx, %r8
	movl	12(%rsp), %ecx
	movslq	(%r10,%r8,4), %rax
	movl	%ecx, (%r9,%r8,4)
	cmpl	$-1, %eax
	jne	.L22
.L11:
	movl	(%r11,%r8,4), %ecx
	cmpl	$-1, %ecx
	je	.L10
	addl	$1, 12(%rsp)
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L12:
	movslq	(%r11,%rax,4), %rax
	cmpl	$-1, %eax
	je	.L11
	addl	$1, %ecx
.L22:
	movl	(%r10,%rax,4), %r12d
	movl	%ecx, (%r9,%rax,4)
	cmpl	$-1, %r12d
	je	.L12
	movl	%ecx, %r15d
.L21:
	movslq	%r12d, %r13
	movslq	(%r10,%r13,4), %rbx
	movl	%r15d, (%r9,%r13,4)
	cmpl	$-1, %ebx
	je	.L13
	movl	%r15d, %r12d
.L20:
	movslq	(%r10,%rbx,4), %r14
	movl	%r12d, (%r9,%rbx,4)
	cmpl	$-1, %r14d
	je	.L14
	movl	%r12d, %edx
.L19:
	movslq	(%r10,%r14,4), %rbp
	movl	%edx, (%r9,%r14,4)
	cmpl	$-1, %ebp
	je	.L15
	movl	(%r10,%rbp,4), %edi
	movl	%edx, %esi
	movl	%esi, (%r9,%rbp,4)
	cmpl	$-1, %edi
	je	.L16
.L82:
	movq	%rax, 72(%rsp)
	movq	%r8, 64(%rsp)
	movl	%edx, 60(%rsp)
	movl	%ecx, 56(%rsp)
	movl	%esi, 52(%rsp)
	call	setDepth
	leaq	left(%rip), %r11
	movl	52(%rsp), %esi
	movl	56(%rsp), %ecx
	movslq	(%r11,%rbp,4), %rbp
	movl	60(%rsp), %edx
	leaq	D(%rip), %r9
	leaq	right(%rip), %r10
	movq	64(%rsp), %r8
	movq	72(%rsp), %rax
	cmpl	$-1, %ebp
	je	.L15
	.p2align 4,,10
	.p2align 3
.L17:
	movl	(%r10,%rbp,4), %edi
	addl	$1, %esi
	movl	%esi, (%r9,%rbp,4)
	cmpl	$-1, %edi
	jne	.L82
.L16:
	movslq	(%r11,%rbp,4), %rbp
	cmpl	$-1, %ebp
	jne	.L17
.L15:
	movslq	(%r11,%r14,4), %r14
	cmpl	$-1, %r14d
	je	.L14
	addl	$1, %edx
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L14:
	movslq	(%r11,%rbx,4), %rbx
	cmpl	$-1, %ebx
	je	.L13
	addl	$1, %r12d
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L13:
	movl	(%r11,%r13,4), %r12d
	cmpl	$-1, %r12d
	je	.L12
	addl	$1, %r15d
	jmp	.L21
.L10:
	movq	16(%rsp), %rax
	movslq	(%r11,%rax,4), %rax
	cmpl	$-1, %eax
	je	.L9
	addl	$1, 24(%rsp)
	jmp	.L24
.L9:
	movq	32(%rsp), %rax
	movslq	(%r11,%rax,4), %rax
	cmpl	$-1, %eax
	je	.L8
	addl	$1, 28(%rsp)
	jmp	.L25
.L8:
	movq	40(%rsp), %rax
	movslq	(%r11,%rax,4), %rax
	cmpl	$-1, %eax
	je	.L7
	addl	$1, 48(%rsp)
	jmp	.L27
.L7:
	addq	$88, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE24:
	.size	setDepth, .-setDepth
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"node %d: "
.LC1:
	.string	"parent = %d, "
.LC2:
	.string	"depth = %d, "
.LC3:
	.string	"root, "
.LC4:
	.string	"leaf, "
.LC5:
	.string	"internal node, "
.LC6:
	.string	"]"
.LC7:
	.string	", "
.LC8:
	.string	"%d"
	.text
	.p2align 4
	.globl	printChildren
	.type	printChildren, @function
printChildren:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rsi
	xorl	%eax, %eax
	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
	movl	%ebp, %edx
	leaq	parent(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	call	__printf_chk@PLT
	movl	(%rbx,%rbp,4), %edx
	movl	$1, %edi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movslq	(%rbx,%rbp,4), %rax
	xorl	%edx, %edx
	cmpl	$-1, %eax
	je	.L84
	.p2align 4,,10
	.p2align 3
.L85:
	movslq	(%rbx,%rax,4), %rax
	addl	$1, %edx
	cmpl	$-1, %eax
	jne	.L85
.L84:
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	cmpl	$-1, (%rbx,%rbp,4)
	je	.L97
	leaq	left(%rip), %rbx
	cmpl	$-1, (%rbx,%rbp,4)
	je	.L98
	leaq	.LC5(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L87:
	movl	$91, %edi
	leaq	.LC8(%rip), %r12
	leaq	.LC7(%rip), %r13
	call	putchar@PLT
	movslq	(%rbx,%rbp,4), %rbx
	leaq	right(%rip), %rbp
	cmpl	$-1, %ebx
	jne	.L89
	jmp	.L91
	.p2align 4,,10
	.p2align 3
.L90:
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L89:
	movl	%ebx, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movslq	0(%rbp,%rbx,4), %rbx
	cmpl	$-1, %ebx
	jne	.L90
.L91:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	leaq	.LC6(%rip), %rdi
	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
	jmp	puts@PLT
	.p2align 4,,10
	.p2align 3
.L98:
	.cfi_restore_state
	leaq	.LC4(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L87
	.p2align 4,,10
	.p2align 3
.L97:
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	left(%rip), %rbx
	jmp	.L87
	.cfi_endproc
.LFE25:
	.size	printChildren, .-printChildren
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB26:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	n(%rip), %rsi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC8(%rip), %rbx
	movq	%rbx, %rdi
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	n(%rip), %rax
	testl	%eax, %eax
	jle	.L101
	leaq	0(,%rax,4), %r12
	movl	$255, %esi
	leaq	right(%rip), %rdi
	movq	%r12, %rdx
	leaq	parent(%rip), %rbp
	call	memset@PLT
	movq	%r12, %rdx
	movl	$255, %esi
	leaq	left(%rip), %rdi
	call	memset@PLT
	movq	%r12, %rdx
	movl	$255, %esi
	movq	%rbp, %rdi
	call	memset@PLT
	leaq	48(%rsp), %rax
	leaq	52(%rsp), %r12
	movl	$0, 24(%rsp)
	movq	%rax, 16(%rsp)
	leaq	44(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L105:
	movq	16(%rsp), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %edx
	testl	%edx, %edx
	jle	.L102
	xorl	%r13d, %r13d
	jmp	.L104
	.p2align 4,,10
	.p2align 3
.L127:
	movslq	48(%rsp), %rdx
	movslq	52(%rsp), %r14
	leaq	left(%rip), %rdi
	cmpl	$1, 44(%rsp)
	movl	%r14d, (%rdi,%rdx,4)
	movl	%edx, 0(%rbp,%r14,4)
	jle	.L117
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	movl	$1, %r13d
	call	__isoc99_scanf@PLT
.L103:
	movl	52(%rsp), %r15d
	leaq	right(%rip), %rax
	movl	48(%rsp), %esi
	addl	$1, %r13d
	movl	%r15d, (%rax,%r14,4)
	movslq	%r15d, %rax
	movl	%esi, 0(%rbp,%rax,4)
	cmpl	%r13d, 44(%rsp)
	jle	.L102
.L104:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	testl	%r13d, %r13d
	je	.L127
	movslq	%r15d, %r14
	jmp	.L103
	.p2align 4,,10
	.p2align 3
.L117:
	movl	%r14d, %r15d
.L102:
	addl	$1, 24(%rsp)
	movl	n(%rip), %eax
	movl	24(%rsp), %edx
	cmpl	%edx, %eax
	jg	.L105
	testl	%eax, %eax
	jle	.L101
	leal	-1(%rax), %edx
	cmpl	$2, %edx
	jbe	.L118
	movl	%eax, %ecx
	leaq	parent(%rip), %rdx
	pcmpeqd	%xmm3, %xmm3
	movdqa	.LC9(%rip), %xmm2
	shrl	$2, %ecx
	leaq	16(%rdx), %rsi
	movdqa	.LC10(%rip), %xmm5
	movdqa	%xmm3, %xmm4
	subl	$1, %ecx
	salq	$4, %rcx
	addq	%rsi, %rcx
	.p2align 4,,10
	.p2align 3
.L108:
	movdqa	%xmm4, %xmm0
	movdqa	%xmm2, %xmm1
	paddd	%xmm5, %xmm2
	addq	$16, %rdx
	pcmpeqd	-16(%rdx), %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm3, %xmm0
	movdqa	%xmm0, %xmm3
	por	%xmm1, %xmm3
	cmpq	%rcx, %rdx
	jne	.L108
	movdqa	%xmm3, %xmm0
	movl	$0, %ebx
	psrldq	$8, %xmm0
	movdqa	%xmm0, %xmm1
	pcmpgtd	%xmm3, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm3, %xmm1
	por	%xmm0, %xmm1
	movdqa	%xmm1, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm0
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm2
	pandn	%xmm1, %xmm0
	por	%xmm2, %xmm0
	movd	%xmm0, %edx
	cmpl	$-1, %edx
	cmove	%ebx, %edx
	movl	%edx, 28(%rsp)
	movl	%eax, %edx
	andl	$-4, %edx
	testb	$3, %al
	je	.L101
.L107:
	movl	28(%rsp), %ebx
	movslq	%edx, %rcx
	cmpl	$-1, 0(%rbp,%rcx,4)
	leal	1(%rdx), %ecx
	cmove	%edx, %ebx
	movl	%ebx, 28(%rsp)
	cmpl	%ecx, %eax
	jle	.L101
	movslq	%ecx, %rsi
	cmpl	$-1, 0(%rbp,%rsi,4)
	cmovne	%ebx, %ecx
	addl	$2, %edx
	movl	%ecx, 28(%rsp)
	cmpl	%edx, %eax
	jle	.L101
	movslq	%edx, %rax
	cmpl	$-1, 0(%rbp,%rax,4)
	cmovne	%ecx, %edx
	movl	%edx, 28(%rsp)
.L101:
	movl	28(%rsp), %edi
	xorl	%esi, %esi
	xorl	%ebx, %ebx
	call	setDepth
	movl	n(%rip), %eax
	testl	%eax, %eax
	jle	.L114
	.p2align 4,,10
	.p2align 3
.L113:
	movl	%ebx, %edi
	addl	$1, %ebx
	call	printChildren
	cmpl	%ebx, n(%rip)
	jg	.L113
.L114:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L128
	addq	$72, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L118:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L107
.L128:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE26:
	.size	main, .-main
	.globl	D
	.bss
	.align 32
	.type	D, @object
	.size	D, 400020
D:
	.zero	400020
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	right
	.align 32
	.type	right, @object
	.size	right, 400020
right:
	.zero	400020
	.globl	left
	.align 32
	.type	left, @object
	.size	left, 400020
left:
	.zero	400020
	.globl	parent
	.align 32
	.type	parent, @object
	.size	parent, 400020
parent:
	.zero	400020
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC9:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC10:
	.long	4
	.long	4
	.long	4
	.long	4
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include<stdio.h>
#define MAX 100005

int parent[MAX], left[MAX], right[MAX];
int n, D[MAX];

int getDepth(int u){
  int d = 0;
  while(parent[u] != -1){
    u = parent[u];
    d++;
  }
  return d;
}
void setDepth(int u, int p){
  D[u] = p;
  if(right[u] != -1){
    setDepth(right[u], p);
  }
  if(left[u] != -1){
    setDepth(left[u], p+1 );
  }
}

void printChildren(int u){

  int i, c;

  printf("node %d: ", u);
  printf("parent = %d, ", parent[u]);
  printf("depth = %d, ", getDepth(u));

  if(parent[u] == -1 ) printf("root, ");
  else if(left[u] == -1 ) printf("leaf, ");
  else printf("internal node, ");

  printf("[");

  for( i = 0, c = left[u] ; c != -1 ; i++, c = right[c]){
    if(i) printf(", ");
    printf("%d", c);
  }
  printf("]\n");
}

int main(){
  int i, j, d, v, c, l, r;
  scanf("%d", &n);
  for(i = 0 ; i < n ; i++)  parent[i] = left[i] = right[i] = -1;

  for( i = 0 ; i < n ; i++){
    scanf("%d", &v);
    scanf("%d", &d);
    for( j = 0 ; j < d ; j++){
      scanf("%d", &c);
      if( j == 0 ) left[v] = c;
      else right[l] = c;
      l = c;
      parent[c] = v;
    }
  }
  for( i = 0 ; i < n ; i++){
    if( parent[i] == -1 ) r = i;
  }

  setDepth(r, 0);

  for( i = 0 ; i < n ; i++) printChildren(i);

  return 0;
}


4
1 3 2 3 0
0 0
3 0
2 0
 4
1 3 2 3 0
0 0
3 0
2 0

node 0: parent = 1, depth = 1, leaf, []
node 1: parent = -1, depth = 0, root, [2, 3, 0]
node 2: parent = 1, depth = 1, leaf, []
node 3: parent = 1, depth = 1, leaf, []
 node 0: parent = 1, depth = 1, leaf, []
node 1: parent = -1, depth = 0, root, [2, 3, 0]
node 2: parent = 1, depth = 1, leaf, []
node 3: parent = 1, depth = 1, leaf, []

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

```c
#include<stdio.h>
#define MAX 100005

int parent[MAX], left[MAX], right[MAX];
int n, D[MAX];

int getDepth(int u){
  int d = 0;
  while(parent[u] != -1){
    u = parent[u];
    d++;
  }
  return d;
}
void setDepth(int u, int p){
  D[u] = p;
  if(right[u] != -1){
    setDepth(right[u], p);
  }
  if(left[u] != -1){
    setDepth(left[u], p+1 );
  }
}

void printChildren(int u){

  int i, c;

  printf("node %d: ", u);
  printf("parent = %d, ", parent[u]);
  printf("depth = %d, ", getDepth(u));

  if(parent[u] == -1 ) printf("root, ");
  else if(left[u] == -1 ) printf("leaf, ");
  else printf("internal node, ");

  printf("[");

  for( i = 0, c = left[u] ; c != -1 ; i++, c = right[c]){
    if(i) printf(", ");
    printf("%d", c);
  }
  printf("]\n");
}

int main(){
  int i, j, d, v, c, l, r;
  scanf("%d", &n);
  for(i = 0 ; i < n ; i++)  parent[i] = left[i] = right[i] = -1;

  for( i = 0 ; i < n ; i++){
    scanf("%d", &v);
    scanf("%d", &d);
    for( j = 0 ; j < d ; j++){
      scanf("%d", &c);
      if( j == 0 ) left[v] = c;
      else right[l] = c;
      l = c;
      parent[c] = v;
    }
  }
  for( i = 0 ; i < n ; i++){
    if( parent[i] == -1 ) r = i;
  }

  setDepth(r, 0);

  for( i = 0 ; i < n ; i++) printChildren(i);

  return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	parent
	.bss
	.align 32
	.type	parent, @object
	.size	parent, 400020
parent:
	.zero	400020
	.globl	left
	.align 32
	.type	left, @object
	.size	left, 400020
left:
	.zero	400020
	.globl	right
	.align 32
	.type	right, @object
	.size	right, 400020
right:
	.zero	400020
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	D
	.align 32
	.type	D, @object
	.size	D, 400020
D:
	.zero	400020
	.text
	.globl	getDepth
	.type	getDepth, @function
getDepth:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L2
.L3:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	parent(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -20(%rbp)
	addl	$1, -4(%rbp)
.L2:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	parent(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	jne	.L3
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	getDepth, .-getDepth
	.globl	setDepth
	.type	setDepth, @function
setDepth:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	D(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	right(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L6
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	right(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-8(%rbp), %edx
	movl	%edx, %esi
	movl	%eax, %edi
	call	setDepth
.L6:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	left(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L8
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	left(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	setDepth
.L8:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	setDepth, .-setDepth
	.section	.rodata
.LC0:
	.string	"node %d: "
.LC1:
	.string	"parent = %d, "
.LC2:
	.string	"depth = %d, "
.LC3:
	.string	"root, "
.LC4:
	.string	"leaf, "
.LC5:
	.string	"internal node, "
.LC6:
	.string	", "
.LC7:
	.string	"%d"
.LC8:
	.string	"]"
	.text
	.globl	printChildren
	.type	printChildren, @function
printChildren:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	parent(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	getDepth
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	parent(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	jne	.L10
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L11
.L10:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	left(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	jne	.L12
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L11
.L12:
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L11:
	movl	$91, %edi
	call	putchar@PLT
	movl	$0, -8(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	left(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	jmp	.L13
.L15:
	cmpl	$0, -8(%rbp)
	je	.L14
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L14:
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC7(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -8(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	right(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
.L13:
	cmpl	$-1, -4(%rbp)
	jne	.L15
	leaq	.LC8(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	printChildren, .-printChildren
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC7(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -24(%rbp)
	jmp	.L17
.L18:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	right(%rip), %rax
	movl	$-1, (%rdx,%rax)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	right(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	left(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	left(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	parent(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -24(%rbp)
.L17:
	movl	n(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L18
	movl	$0, -24(%rbp)
	jmp	.L19
.L24:
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC7(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC7(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -20(%rbp)
	jmp	.L20
.L23:
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC7(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$0, -20(%rbp)
	jne	.L21
	movl	-32(%rbp), %edx
	movl	-28(%rbp), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	left(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	jmp	.L22
.L21:
	movl	-28(%rbp), %eax
	movl	-16(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	right(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L22:
	movl	-28(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	-28(%rbp), %edx
	movl	-32(%rbp), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	parent(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L20:
	movl	-36(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L23
	addl	$1, -24(%rbp)
.L19:
	movl	n(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L24
	movl	$0, -24(%rbp)
	jmp	.L25
.L27:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	parent(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	jne	.L26
	movl	-24(%rbp), %eax
	movl	%eax, -12(%rbp)
.L26:
	addl	$1, -24(%rbp)
.L25:
	movl	n(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L27
	movl	-12(%rbp), %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	setDepth
	movl	$0, -24(%rbp)
	jmp	.L28
.L29:
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	call	printChildren
	addl	$1, -24(%rbp)
.L28:
	movl	n(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L29
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	parent
	.bss
	.align 32
	.type	parent, @object
	.size	parent, 400020
parent:
	.zero	400020
	.globl	left
	.align 32
	.type	left, @object
	.size	left, 400020
left:
	.zero	400020
	.globl	right
	.align 32
	.type	right, @object
	.size	right, 400020
right:
	.zero	400020
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	D
	.align 32
	.type	D, @object
	.size	D, 400020
D:
	.zero	400020
	.text
	.globl	getDepth
	.type	getDepth, @function
getDepth:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L2
.L3:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	parent(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -20(%rbp)
	addl	$1, -4(%rbp)
.L2:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	parent(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	jne	.L3
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	getDepth, .-getDepth
	.globl	setDepth
	.type	setDepth, @function
setDepth:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	D(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	right(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L6
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	right(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-8(%rbp), %edx
	movl	%edx, %esi
	movl	%eax, %edi
	call	setDepth
.L6:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	left(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L8
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	left(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	setDepth
.L8:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	setDepth, .-setDepth
	.section	.rodata
.LC0:
	.string	"node %d: "
.LC1:
	.string	"parent = %d, "
.LC2:
	.string	"depth = %d, "
.LC3:
	.string	"root, "
.LC4:
	.string	"leaf, "
.LC5:
	.string	"internal node, "
.LC6:
	.string	", "
.LC7:
	.string	"%d"
.LC8:
	.string	"]"
	.text
	.globl	printChildren
	.type	printChildren, @function
printChildren:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	parent(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	getDepth
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	parent(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	jne	.L10
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L11
.L10:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	left(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	jne	.L12
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L11
.L12:
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L11:
	movl	$91, %edi
	call	putchar@PLT
	movl	$0, -8(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	left(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	jmp	.L13
.L15:
	cmpl	$0, -8(%rbp)
	je	.L14
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L14:
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC7(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -8(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	right(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
.L13:
	cmpl	$-1, -4(%rbp)
	jne	.L15
	leaq	.LC8(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	printChildren, .-printChildren
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC7(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -24(%rbp)
	jmp	.L17
.L18:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	right(%rip), %rax
	movl	$-1, (%rdx,%rax)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	right(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	left(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	left(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	parent(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -24(%rbp)
.L17:
	movl	n(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L18
	movl	$0, -24(%rbp)
	jmp	.L19
.L24:
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC7(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC7(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -20(%rbp)
	jmp	.L20
.L23:
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC7(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$0, -20(%rbp)
	jne	.L21
	movl	-32(%rbp), %edx
	movl	-28(%rbp), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	left(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	jmp	.L22
.L21:
	movl	-28(%rbp), %eax
	movl	-16(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	right(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L22:
	movl	-28(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	-28(%rbp), %edx
	movl	-32(%rbp), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	parent(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L20:
	movl	-36(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L23
	addl	$1, -24(%rbp)
.L19:
	movl	n(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L24
	movl	$0, -24(%rbp)
	jmp	.L25
.L27:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	parent(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	jne	.L26
	movl	-24(%rbp), %eax
	movl	%eax, -12(%rbp)
.L26:
	addl	$1, -24(%rbp)
.L25:
	movl	n(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L27
	movl	-12(%rbp), %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	setDepth
	movl	$0, -24(%rbp)
	jmp	.L28
.L29:
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	call	printChildren
	addl	$1, -24(%rbp)
.L28:
	movl	n(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L29
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
