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>
struct Node {
  int parent;
  int left;
  int right;
};
int n;
struct Node tree[30];
int dipth[30],height[30];
void getdip(int,int);
int gettree(int);
int getsibling(int);
void printtree(int);
int main(){
  int i,id,left,right,root;
  scanf("%d",&n);
  for(i=0;i<n;i++)tree[i].parent=tree[i].left=tree[i].right=-1;
  for(i=0;i<n;i++){
    scanf("%d %d %d",&id,&left,&right);
    tree[id].left=left;
    tree[id].right=right;
    if(left!=-1)tree[left].parent=id;
    if(right!=-1)tree[right].parent=id;
  }
  for(i=0;i<n;i++){
    if(tree[i].parent==-1)root=i;
  }
  getdip(root,0);
  getheight(root);
  for(i=0;i<n;i++)printtree(i);
  return 0;
}
int getheight(int root){
  int h1=0,h2=0;
  if(tree[root].left!=-1)h1=getheight(tree[root].left)+1;
  if(tree[root].right!=-1)h2=getheight(tree[root].right)+1;
  if(h1>h2)height[root]=h1;
  else height[root]=h2;
  return height[root];
}
int getsibling(int num){
  if(tree[num].parent==-1)return -1;
  if(tree[tree[num].parent].left!=num&&tree[tree[num].parent].left!=-1)return tree[tree[num]\
.parent].left;
  else if(tree[tree[num].parent].right!=num&&tree[tree[num].parent].right!=-1)return tree[tr\
ee[num].parent].right;
  return -1;
}
void getdip(int r,int d){
  if(r==-1)return;
  dipth[r]=d;
  if(tree[r].right!=-1)getdip(tree[r].right,d+1);
  if(tree[r].left!=-1)getdip(tree[r].left,d+1);
}
void printtree(int i){
  int m,j=0,digree=0;
  if(tree[i].right!=-1)digree++;
  if(tree[i].left!=-1)digree++;
  printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, ",i,tree\
[i].parent,getsibling(i),digree,dipth[i],height[i]);
  if(tree[i].parent==-1)printf("root");
  else if(tree[i].left==-1&&tree[i].right==-1)printf("leaf");
  else printf("internal node");
  printf("\n");
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	tree
	.align 32
	.type	tree, @object
	.size	tree, 360
tree:
	.zero	360
	.globl	dipth
	.align 32
	.type	dipth, @object
	.size	dipth, 120
dipth:
	.zero	120
	.globl	height
	.align 32
	.type	height, @object
	.size	height, 120
height:
	.zero	120
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -16(%rbp)
	jmp	.L2
.L3:
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+tree(%rip), %rax
	movl	$-1, (%rdx,%rax)
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+tree(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	4+tree(%rip), %rax
	movl	%edx, (%rcx,%rax)
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+tree(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	tree(%rip), %rax
	movl	%edx, (%rcx,%rax)
	addl	$1, -16(%rbp)
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L3
	movl	$0, -16(%rbp)
	jmp	.L4
.L7:
	leaq	-20(%rbp), %rcx
	leaq	-24(%rbp), %rdx
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	movl	-24(%rbp), %edx
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	4+tree(%rip), %rax
	movl	%edx, (%rcx,%rax)
	movl	-28(%rbp), %eax
	movl	-20(%rbp), %edx
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	8+tree(%rip), %rax
	movl	%edx, (%rcx,%rax)
	movl	-24(%rbp), %eax
	cmpl	$-1, %eax
	je	.L5
	movl	-24(%rbp), %eax
	movl	-28(%rbp), %edx
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	tree(%rip), %rax
	movl	%edx, (%rcx,%rax)
.L5:
	movl	-20(%rbp), %eax
	cmpl	$-1, %eax
	je	.L6
	movl	-20(%rbp), %eax
	movl	-28(%rbp), %edx
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	tree(%rip), %rax
	movl	%edx, (%rcx,%rax)
.L6:
	addl	$1, -16(%rbp)
.L4:
	movl	n(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L7
	movl	$0, -16(%rbp)
	jmp	.L8
.L10:
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	jne	.L9
	movl	-16(%rbp), %eax
	movl	%eax, -12(%rbp)
.L9:
	addl	$1, -16(%rbp)
.L8:
	movl	n(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L10
	movl	-12(%rbp), %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	getdip
	movl	-12(%rbp), %eax
	movl	%eax, %edi
	movl	$0, %eax
	call	getheight
	movl	$0, -16(%rbp)
	jmp	.L11
.L12:
	movl	-16(%rbp), %eax
	movl	%eax, %edi
	call	printtree
	addl	$1, -16(%rbp)
.L11:
	movl	n(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L12
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	getheight
	.type	getheight, @function
getheight:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	$0, -8(%rbp)
	movl	$0, -4(%rbp)
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L16
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %edi
	call	getheight
	addl	$1, %eax
	movl	%eax, -8(%rbp)
.L16:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L17
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %edi
	call	getheight
	addl	$1, %eax
	movl	%eax, -4(%rbp)
.L17:
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jle	.L18
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	height(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L19
.L18:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	height(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L19:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	height(%rip), %rax
	movl	(%rdx,%rax), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	getheight, .-getheight
	.globl	getsibling
	.type	getsibling, @function
getsibling:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	jne	.L22
	movl	$-1, %eax
	jmp	.L23
.L22:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	je	.L24
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L24
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L23
.L24:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	je	.L25
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L25
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L23
.L25:
	movl	$-1, %eax
.L23:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	getsibling, .-getsibling
	.globl	getdip
	.type	getdip, @function
getdip:
.LFB3:
	.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)
	cmpl	$-1, -4(%rbp)
	je	.L30
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	dipth(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L29
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	8+tree(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	getdip
.L29:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L26
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	4+tree(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	getdip
	jmp	.L26
.L30:
	nop
.L26:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	getdip, .-getdip
	.section	.rodata
	.align 8
.LC2:
	.string	"node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, "
.LC3:
	.string	"root"
.LC4:
	.string	"leaf"
.LC5:
	.string	"internal node"
	.text
	.globl	printtree
	.type	printtree, @function
printtree:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset 12, -24
	.cfi_offset 3, -32
	movl	%edi, -36(%rbp)
	movl	$0, -20(%rbp)
	movl	$0, -24(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L32
	addl	$1, -24(%rbp)
.L32:
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L33
	addl	$1, -24(%rbp)
.L33:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	height(%rip), %rax
	movl	(%rdx,%rax), %ebx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dipth(%rip), %rax
	movl	(%rdx,%rax), %r12d
	movl	-36(%rbp), %eax
	movl	%eax, %edi
	call	getsibling
	movl	%eax, %ecx
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	tree(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %esi
	movl	-36(%rbp), %eax
	subq	$8, %rsp
	pushq	%rbx
	movl	%r12d, %r9d
	movl	%esi, %r8d
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addq	$16, %rsp
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	jne	.L34
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L35
.L34:
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	jne	.L36
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	jne	.L36
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L35
.L36:
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L35:
	movl	$10, %edi
	call	putchar@PLT
	nop
	leaq	-16(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	printtree, .-printtree
	.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	getheight
	.type	getheight, @function
getheight:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	tree(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movslq	%edi, %rbx
	leaq	(%rbx,%rbx,2), %rax
	leaq	0(%rbp,%rax,4), %rax
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movl	4(%rax), %edx
	cmpl	$-1, %edx
	jne	.L110
	movl	8(%rax), %edx
	leaq	height(%rip), %r13
	xorl	%eax, %eax
	cmpl	$-1, %edx
	jne	.L111
.L47:
	movl	%eax, 0(%r13,%rbx,4)
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L111:
	.cfi_restore_state
	xorl	%r15d, %r15d
	leaq	height(%rip), %r13
.L46:
	movslq	%edx, %r12
	leaq	(%r12,%r12,2), %rax
	leaq	0(%rbp,%rax,4), %rax
	movl	4(%rax), %edx
	cmpl	$-1, %edx
	je	.L18
	movslq	%edx, %r14
	leaq	(%r14,%r14,2), %rax
	leaq	0(%rbp,%rax,4), %rax
	movslq	4(%rax), %rdx
	cmpl	$-1, %edx
	jne	.L112
	movslq	8(%rax), %rdx
	cmpl	$-1, %edx
	jne	.L82
	movl	$1, %edx
	xorl	%eax, %eax
.L43:
	movl	%eax, 0(%r13,%r14,4)
	leaq	(%r12,%r12,2), %rax
	xorl	%ecx, %ecx
	movl	8(%rbp,%rax,4), %eax
	cmpl	$-1, %eax
	jne	.L38
.L25:
	cmpl	%edx, %ecx
	cmovl	%edx, %ecx
	leal	1(%rcx), %eax
	jmp	.L39
	.p2align 4,,10
	.p2align 3
.L110:
	movslq	%edx, %r12
	leaq	(%r12,%r12,2), %rax
	leaq	0(%rbp,%rax,4), %rax
	movl	4(%rax), %edx
	cmpl	$-1, %edx
	je	.L3
	movslq	%edx, %r14
	leaq	(%r14,%r14,2), %rax
	leaq	0(%rbp,%rax,4), %rax
	movl	4(%rax), %edx
	cmpl	$-1, %edx
	jne	.L113
	movl	8(%rax), %edx
	cmpl	$-1, %edx
	jne	.L90
	movl	$1, %r15d
	xorl	%eax, %eax
	leaq	height(%rip), %r13
.L59:
	movl	%eax, 0(%r13,%r14,4)
	leaq	(%r12,%r12,2), %rax
	movl	8(%rbp,%rax,4), %edx
	xorl	%eax, %eax
	cmpl	$-1, %edx
	jne	.L54
.L10:
	cmpl	%r15d, %eax
	cmovl	%r15d, %eax
	leal	1(%rax), %r15d
	jmp	.L55
	.p2align 4,,10
	.p2align 3
.L18:
	movl	8(%rax), %eax
	cmpl	$-1, %eax
	jne	.L80
	movl	$1, %eax
	xorl	%ecx, %ecx
.L39:
	movl	%ecx, 0(%r13,%r12,4)
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L3:
	movl	8(%rax), %edx
	cmpl	$-1, %edx
	jne	.L88
	movl	$1, %r15d
	xorl	%eax, %eax
	leaq	height(%rip), %r13
.L55:
	movl	%eax, 0(%r13,%r12,4)
	leaq	(%rbx,%rbx,2), %rax
	movl	8(%rbp,%rax,4), %edx
	xorl	%eax, %eax
	cmpl	$-1, %edx
	jne	.L46
.L17:
	cmpl	%r15d, %eax
	cmovl	%r15d, %eax
	jmp	.L47
	.p2align 4,,10
	.p2align 3
.L88:
	xorl	%r15d, %r15d
	leaq	height(%rip), %r13
.L54:
	movslq	%edx, %r14
	leaq	(%r14,%r14,2), %rax
	leaq	0(%rbp,%rax,4), %rax
	movslq	4(%rax), %rdx
	cmpl	$-1, %edx
	je	.L11
	leaq	(%rdx,%rdx,2), %rax
	leaq	0(%rbp,%rax,4), %rsi
	movl	4(%rsi), %edi
	cmpl	$-1, %edi
	je	.L12
	movq	%rdx, 8(%rsp)
	movq	%rsi, (%rsp)
	call	getheight
	movq	(%rsp), %rsi
	movq	8(%rsp), %rdx
	leal	1(%rax), %ecx
	xorl	%eax, %eax
	movl	8(%rsi), %edi
	cmpl	$-1, %edi
	jne	.L52
.L13:
	cmpl	%ecx, %eax
	cmovl	%ecx, %eax
	leal	1(%rax), %esi
.L53:
	movl	%eax, 0(%r13,%rdx,4)
	leaq	(%r14,%r14,2), %rax
	xorl	%ecx, %ecx
	movl	8(%rbp,%rax,4), %eax
	cmpl	$-1, %eax
	je	.L14
.L50:
	movslq	%eax, %rdx
	leaq	(%rdx,%rdx,2), %rax
	leaq	0(%rbp,%rax,4), %r8
	movl	4(%r8), %edi
	cmpl	$-1, %edi
	je	.L15
	movq	%rdx, 16(%rsp)
	movq	%r8, 8(%rsp)
	movl	%esi, (%rsp)
	call	getheight
	movq	8(%rsp), %r8
	movl	(%rsp), %esi
	leal	1(%rax), %ecx
	xorl	%eax, %eax
	movq	16(%rsp), %rdx
	movl	8(%r8), %edi
	cmpl	$-1, %edi
	jne	.L48
.L16:
	cmpl	%ecx, %eax
	cmovl	%ecx, %eax
	leal	1(%rax), %ecx
.L49:
	movl	%eax, 0(%r13,%rdx,4)
.L14:
	cmpl	%esi, %ecx
	cmovl	%esi, %ecx
	leal	1(%rcx), %eax
.L51:
	movl	%ecx, 0(%r13,%r14,4)
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L80:
	xorl	%edx, %edx
.L38:
	movslq	%eax, %r14
	leaq	(%r14,%r14,2), %rax
	leaq	0(%rbp,%rax,4), %rax
	movslq	4(%rax), %rcx
	cmpl	$-1, %ecx
	je	.L26
	leaq	(%rcx,%rcx,2), %rax
	leaq	0(%rbp,%rax,4), %r8
	movl	4(%r8), %edi
	cmpl	$-1, %edi
	je	.L27
	movq	%rcx, 16(%rsp)
	movq	%r8, 8(%rsp)
	movl	%edx, (%rsp)
	call	getheight
	movq	8(%rsp), %r8
	movl	(%rsp), %edx
	leal	1(%rax), %esi
	xorl	%eax, %eax
	movq	16(%rsp), %rcx
	movl	8(%r8), %edi
	cmpl	$-1, %edi
	jne	.L36
.L28:
	cmpl	%esi, %eax
	cmovl	%esi, %eax
	leal	1(%rax), %r8d
.L37:
	movl	%eax, 0(%r13,%rcx,4)
	leaq	(%r14,%r14,2), %rax
	movslq	8(%rbp,%rax,4), %rcx
	xorl	%eax, %eax
	cmpl	$-1, %ecx
	je	.L29
.L34:
	leaq	(%rcx,%rcx,2), %rax
	leaq	0(%rbp,%rax,4), %rsi
	movl	4(%rsi), %edi
	cmpl	$-1, %edi
	je	.L30
	movq	%rcx, 24(%rsp)
	movq	%rsi, 16(%rsp)
	movl	%edx, 8(%rsp)
	movl	%r8d, (%rsp)
	call	getheight
	movq	16(%rsp), %rsi
	movl	(%rsp), %r8d
	movl	8(%rsp), %edx
	movq	24(%rsp), %rcx
	leal	1(%rax), %ebp
	movl	8(%rsi), %edi
	xorl	%esi, %esi
	cmpl	$-1, %edi
	jne	.L32
.L31:
	cmpl	%ebp, %esi
	cmovl	%ebp, %esi
	leal	1(%rsi), %eax
.L33:
	movl	%esi, 0(%r13,%rcx,4)
.L29:
	cmpl	%r8d, %eax
	cmovl	%r8d, %eax
	leal	1(%rax), %ecx
.L35:
	movl	%eax, 0(%r13,%r14,4)
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L113:
	movslq	%edx, %r15
	leaq	(%r15,%r15,2), %rax
	leaq	0(%rbp,%rax,4), %rdx
	movl	4(%rdx), %edi
	cmpl	$-1, %edi
	je	.L5
	movq	%rdx, (%rsp)
	call	getheight
	movq	(%rsp), %rdx
	leal	1(%rax), %r13d
	xorl	%eax, %eax
	movl	8(%rdx), %edi
	cmpl	$-1, %edi
	jne	.L60
.L6:
	cmpl	%r13d, %eax
	cmovl	%r13d, %eax
	leal	1(%rax), %esi
.L61:
	leaq	height(%rip), %r13
	movl	%eax, 0(%r13,%r15,4)
	leaq	(%r14,%r14,2), %rax
	movl	8(%rbp,%rax,4), %edx
	xorl	%eax, %eax
	cmpl	$-1, %edx
	je	.L7
.L58:
	movslq	%edx, %r15
	leaq	(%r15,%r15,2), %rax
	leaq	0(%rbp,%rax,4), %rcx
	movl	4(%rcx), %edi
	cmpl	$-1, %edi
	je	.L8
	movq	%rcx, 8(%rsp)
	movl	%esi, (%rsp)
	call	getheight
	movq	8(%rsp), %rcx
	movl	(%rsp), %esi
	leal	1(%rax), %edx
	movl	8(%rcx), %edi
	xorl	%ecx, %ecx
	cmpl	$-1, %edi
	jne	.L56
.L9:
	cmpl	%edx, %ecx
	cmovl	%edx, %ecx
	leal	1(%rcx), %eax
.L57:
	movl	%ecx, 0(%r13,%r15,4)
.L7:
	cmpl	%esi, %eax
	cmovl	%esi, %eax
	leal	1(%rax), %r15d
	jmp	.L59
	.p2align 4,,10
	.p2align 3
.L112:
	leaq	(%rdx,%rdx,2), %rax
	leaq	0(%rbp,%rax,4), %rsi
	movl	4(%rsi), %edi
	cmpl	$-1, %edi
	je	.L20
	movq	%rdx, 8(%rsp)
	movq	%rsi, (%rsp)
	call	getheight
	movq	(%rsp), %rsi
	movq	8(%rsp), %rdx
	leal	1(%rax), %ecx
	xorl	%eax, %eax
	movl	8(%rsi), %edi
	cmpl	$-1, %edi
	jne	.L44
.L21:
	cmpl	%ecx, %eax
	cmovl	%ecx, %eax
	leal	1(%rax), %esi
.L45:
	movl	%eax, 0(%r13,%rdx,4)
	leaq	(%r14,%r14,2), %rax
	movslq	8(%rbp,%rax,4), %rdx
	xorl	%eax, %eax
	cmpl	$-1, %edx
	je	.L22
.L42:
	leaq	(%rdx,%rdx,2), %rax
	leaq	0(%rbp,%rax,4), %rcx
	movl	4(%rcx), %edi
	cmpl	$-1, %edi
	je	.L23
	movq	%rdx, 16(%rsp)
	movq	%rcx, 8(%rsp)
	movl	%esi, (%rsp)
	call	getheight
	movq	8(%rsp), %rcx
	movl	(%rsp), %esi
	movq	16(%rsp), %rdx
	leal	1(%rax), %r8d
	movl	8(%rcx), %edi
	xorl	%ecx, %ecx
	cmpl	$-1, %edi
	jne	.L40
.L24:
	cmpl	%r8d, %ecx
	cmovl	%r8d, %ecx
	leal	1(%rcx), %eax
.L41:
	movl	%ecx, 0(%r13,%rdx,4)
.L22:
	cmpl	%esi, %eax
	cmovl	%esi, %eax
	leal	1(%rax), %edx
	jmp	.L43
	.p2align 4,,10
	.p2align 3
.L30:
	movl	8(%rsi), %edi
	cmpl	$-1, %edi
	je	.L114
	xorl	%ebp, %ebp
.L32:
	movq	%rcx, 16(%rsp)
	movl	%edx, 8(%rsp)
	movl	%r8d, (%rsp)
	call	getheight
	movq	16(%rsp), %rcx
	movl	8(%rsp), %edx
	movl	(%rsp), %r8d
	leal	1(%rax), %esi
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L27:
	movl	8(%r8), %edi
	cmpl	$-1, %edi
	je	.L115
	xorl	%esi, %esi
.L36:
	movq	%rcx, 16(%rsp)
	movl	%edx, 8(%rsp)
	movl	%esi, (%rsp)
	call	getheight
	movq	16(%rsp), %rcx
	movl	8(%rsp), %edx
	movl	(%rsp), %esi
	addl	$1, %eax
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L15:
	movl	8(%r8), %edi
	cmpl	$-1, %edi
	je	.L116
	xorl	%ecx, %ecx
.L48:
	movq	%rdx, 16(%rsp)
	movl	%esi, 8(%rsp)
	movl	%ecx, (%rsp)
	call	getheight
	movq	16(%rsp), %rdx
	movl	8(%rsp), %esi
	movl	(%rsp), %ecx
	addl	$1, %eax
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L8:
	movl	8(%rcx), %edi
	cmpl	$-1, %edi
	je	.L117
	xorl	%edx, %edx
.L56:
	movl	%esi, 8(%rsp)
	movl	%edx, (%rsp)
	call	getheight
	movl	8(%rsp), %esi
	movl	(%rsp), %edx
	leal	1(%rax), %ecx
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L23:
	movl	8(%rcx), %edi
	cmpl	$-1, %edi
	je	.L118
	xorl	%r8d, %r8d
.L40:
	movq	%rdx, 16(%rsp)
	movl	%esi, 8(%rsp)
	movl	%r8d, (%rsp)
	call	getheight
	movq	16(%rsp), %rdx
	movl	8(%rsp), %esi
	movl	(%rsp), %r8d
	leal	1(%rax), %ecx
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L12:
	movl	8(%rsi), %edi
	cmpl	$-1, %edi
	je	.L119
	xorl	%ecx, %ecx
.L52:
	movq	%rdx, 8(%rsp)
	movl	%ecx, (%rsp)
	call	getheight
	movq	8(%rsp), %rdx
	movl	(%rsp), %ecx
	addl	$1, %eax
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L20:
	movl	8(%rsi), %edi
	cmpl	$-1, %edi
	je	.L120
	xorl	%ecx, %ecx
.L44:
	movq	%rdx, 8(%rsp)
	movl	%ecx, (%rsp)
	call	getheight
	movq	8(%rsp), %rdx
	movl	(%rsp), %ecx
	addl	$1, %eax
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L5:
	movl	8(%rdx), %edi
	cmpl	$-1, %edi
	je	.L121
	xorl	%r13d, %r13d
.L60:
	call	getheight
	addl	$1, %eax
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L26:
	movslq	8(%rax), %rcx
	cmpl	$-1, %ecx
	jne	.L78
	movl	$1, %ecx
	xorl	%eax, %eax
	jmp	.L35
	.p2align 4,,10
	.p2align 3
.L11:
	movl	8(%rax), %eax
	cmpl	$-1, %eax
	jne	.L86
	movl	$1, %eax
	xorl	%ecx, %ecx
	jmp	.L51
	.p2align 4,,10
	.p2align 3
.L86:
	xorl	%esi, %esi
	jmp	.L50
	.p2align 4,,10
	.p2align 3
.L90:
	xorl	%esi, %esi
	leaq	height(%rip), %r13
	jmp	.L58
	.p2align 4,,10
	.p2align 3
.L82:
	xorl	%esi, %esi
	jmp	.L42
	.p2align 4,,10
	.p2align 3
.L78:
	xorl	%r8d, %r8d
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L119:
	movl	$1, %esi
	xorl	%eax, %eax
	jmp	.L53
	.p2align 4,,10
	.p2align 3
.L118:
	movl	$1, %eax
	xorl	%ecx, %ecx
	jmp	.L41
	.p2align 4,,10
	.p2align 3
.L117:
	movl	$1, %eax
	xorl	%ecx, %ecx
	jmp	.L57
	.p2align 4,,10
	.p2align 3
.L120:
	movl	$1, %esi
	xorl	%eax, %eax
	jmp	.L45
	.p2align 4,,10
	.p2align 3
.L121:
	movl	$1, %esi
	xorl	%eax, %eax
	jmp	.L61
	.p2align 4,,10
	.p2align 3
.L116:
	movl	$1, %ecx
	xorl	%eax, %eax
	jmp	.L49
	.p2align 4,,10
	.p2align 3
.L114:
	movl	$1, %eax
	xorl	%esi, %esi
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L115:
	movl	$1, %r8d
	xorl	%eax, %eax
	jmp	.L37
	.cfi_endproc
.LFE24:
	.size	getheight, .-getheight
	.p2align 4
	.globl	getsibling
	.type	getsibling, @function
getsibling:
.LFB25:
	.cfi_startproc
	endbr64
	movslq	%edi, %rax
	leaq	tree(%rip), %rdx
	leaq	(%rax,%rax,2), %rax
	movslq	(%rdx,%rax,4), %rax
	cmpl	$-1, %eax
	je	.L126
	leaq	(%rax,%rax,2), %rcx
	movl	4(%rdx,%rcx,4), %r8d
	cmpl	$-1, %r8d
	je	.L127
	cmpl	%edi, %r8d
	jne	.L122
.L127:
	leaq	(%rax,%rax,2), %rax
	movl	8(%rdx,%rax,4), %r8d
	cmpl	%edi, %r8d
	je	.L126
	cmpl	$-1, %r8d
	je	.L126
.L122:
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L126:
	movl	$-1, %r8d
	jmp	.L122
	.cfi_endproc
.LFE25:
	.size	getsibling, .-getsibling
	.p2align 4
	.globl	getdip
	.type	getdip, @function
getdip:
.LFB26:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%edi, %rax
	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
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movl	%esi, 32(%rsp)
	cmpl	$-1, %eax
	je	.L135
	leaq	dipth(%rip), %r10
	leaq	tree(%rip), %r11
.L155:
	movl	32(%rsp), %edx
	movq	%rax, 24(%rsp)
	movl	%edx, (%r10,%rax,4)
	leaq	(%rax,%rax,2), %rax
	movslq	8(%r11,%rax,4), %rax
	cmpl	$-1, %eax
	je	.L137
	leal	1(%rdx), %ecx
	movl	%ecx, 12(%rsp)
.L154:
	movl	12(%rsp), %edx
	movq	%rax, 16(%rsp)
	movl	%edx, (%r10,%rax,4)
	leaq	(%rax,%rax,2), %rax
	movslq	8(%r11,%rax,4), %rax
	cmpl	$-1, %eax
	je	.L138
	leal	1(%rdx), %ecx
	movl	%ecx, 8(%rsp)
.L153:
	movl	8(%rsp), %edx
	movq	%rax, (%rsp)
	movl	%edx, (%r10,%rax,4)
	leaq	(%rax,%rax,2), %rax
	movl	8(%r11,%rax,4), %ecx
	cmpl	$-1, %ecx
	je	.L139
	leal	1(%rdx), %r9d
.L152:
	movslq	%ecx, %rdx
	leaq	(%rdx,%rdx,2), %rax
	movl	%r9d, (%r10,%rdx,4)
	movslq	8(%r11,%rax,4), %r15
	cmpl	$-1, %r15d
	je	.L140
	leal	1(%r9), %ecx
.L151:
	leaq	(%r15,%r15,2), %rax
	movl	%ecx, (%r10,%r15,4)
	movslq	8(%r11,%rax,4), %r12
	cmpl	$-1, %r12d
	je	.L141
	leal	1(%rcx), %eax
.L150:
	leaq	(%r12,%r12,2), %rsi
	movl	%eax, (%r10,%r12,4)
	movslq	8(%r11,%rsi,4), %rbx
	cmpl	$-1, %ebx
	je	.L142
	leal	1(%rax), %r13d
.L149:
	leaq	(%rbx,%rbx,2), %rsi
	movl	%r13d, (%r10,%rbx,4)
	movslq	8(%r11,%rsi,4), %rbp
	cmpl	$-1, %ebp
	je	.L143
	leal	2(%r13), %r8d
.L148:
	leal	-1(%r8), %esi
	movl	%esi, (%r10,%rbp,4)
	leaq	0(%rbp,%rbp,2), %rsi
	movslq	8(%r11,%rsi,4), %rdi
	cmpl	$-1, %edi
	je	.L144
	movl	%r8d, %esi
.L147:
	movl	%esi, (%r10,%rdi,4)
	leaq	(%rdi,%rdi,2), %rdi
	leaq	(%r11,%rdi,4), %r14
	movl	8(%r14), %edi
	cmpl	$-1, %edi
	je	.L145
	addl	$1, %esi
	movq	%rdx, 56(%rsp)
	movl	%r8d, 52(%rsp)
	movl	%eax, 48(%rsp)
	movl	%ecx, 44(%rsp)
	movl	%r9d, 40(%rsp)
	movl	%esi, 36(%rsp)
	call	getdip
	movslq	4(%r14), %rdi
	movl	36(%rsp), %esi
	leaq	tree(%rip), %r11
	movl	40(%rsp), %r9d
	movl	44(%rsp), %ecx
	leaq	dipth(%rip), %r10
	cmpl	$-1, %edi
	movl	48(%rsp), %eax
	movl	52(%rsp), %r8d
	movq	56(%rsp), %rdx
	jne	.L147
	.p2align 4,,10
	.p2align 3
.L144:
	leaq	0(%rbp,%rbp,2), %rsi
	addl	$1, %r8d
	movslq	4(%r11,%rsi,4), %rbp
	cmpl	$-1, %ebp
	jne	.L148
.L143:
	leaq	(%rbx,%rbx,2), %rsi
	movslq	4(%r11,%rsi,4), %rbx
	cmpl	$-1, %ebx
	je	.L142
	addl	$1, %r13d
	jmp	.L149
	.p2align 4,,10
	.p2align 3
.L145:
	movslq	4(%r14), %rdi
	cmpl	$-1, %edi
	je	.L144
	addl	$1, %esi
	jmp	.L147
	.p2align 4,,10
	.p2align 3
.L142:
	leaq	(%r12,%r12,2), %rsi
	movslq	4(%r11,%rsi,4), %r12
	cmpl	$-1, %r12d
	je	.L141
	addl	$1, %eax
	jmp	.L150
	.p2align 4,,10
	.p2align 3
.L141:
	leaq	(%r15,%r15,2), %rax
	movslq	4(%r11,%rax,4), %r15
	cmpl	$-1, %r15d
	je	.L140
	addl	$1, %ecx
	jmp	.L151
	.p2align 4,,10
	.p2align 3
.L140:
	leaq	(%rdx,%rdx,2), %rax
	movl	4(%r11,%rax,4), %ecx
	cmpl	$-1, %ecx
	je	.L139
	addl	$1, %r9d
	jmp	.L152
.L139:
	movq	(%rsp), %rax
	leaq	(%rax,%rax,2), %rax
	movslq	4(%r11,%rax,4), %rax
	cmpl	$-1, %eax
	je	.L138
	addl	$1, 8(%rsp)
	jmp	.L153
.L138:
	movq	16(%rsp), %rax
	leaq	(%rax,%rax,2), %rax
	movslq	4(%r11,%rax,4), %rax
	cmpl	$-1, %eax
	je	.L137
	addl	$1, 12(%rsp)
	jmp	.L154
.L137:
	movq	24(%rsp), %rax
	leaq	(%rax,%rax,2), %rax
	movslq	4(%r11,%rax,4), %rax
	cmpl	$-1, %eax
	je	.L135
	addl	$1, 32(%rsp)
	jmp	.L155
.L135:
	addq	$72, %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
.LFE26:
	.size	getdip, .-getdip
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, "
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"root"
.LC2:
	.string	"leaf"
.LC3:
	.string	"internal node"
	.text
	.p2align 4
	.globl	printtree
	.type	printtree, @function
printtree:
.LFB27:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	tree(%rip), %rbp
	xorl	%r9d, %r9d
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movslq	%edi, %rbx
	leaq	(%rbx,%rbx,2), %rax
	movq	%rbx, %rdx
	leaq	0(%rbp,%rax,4), %rax
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	cmpl	$-1, 8(%rax)
	setne	%r9b
	xorl	%ecx, %ecx
	cmpl	$-1, 4(%rax)
	setne	%cl
	addl	%ecx, %r9d
	leaq	height(%rip), %rcx
	movl	(%rcx,%rbx,4), %edi
	leaq	dipth(%rip), %rcx
	movl	(%rcx,%rbx,4), %esi
	movl	(%rax), %ecx
	cmpl	$-1, %ecx
	je	.L221
	movslq	%ecx, %rax
	leaq	(%rax,%rax,2), %r8
	movl	4(%rbp,%r8,4), %r8d
	cmpl	$-1, %r8d
	je	.L222
	cmpl	%r8d, %ebx
	jne	.L215
.L222:
	leaq	(%rax,%rax,2), %rax
	movl	8(%rbp,%rax,4), %r8d
	cmpl	$-1, %r8d
	je	.L221
	cmpl	%r8d, %edx
	je	.L221
.L215:
	pushq	%rdi
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	movl	$1, %edi
	pushq	%rsi
	.cfi_def_cfa_offset 48
	leaq	.LC0(%rip), %rsi
	call	__printf_chk@PLT
	leaq	(%rbx,%rbx,2), %rax
	popq	%rdx
	.cfi_def_cfa_offset 40
	popq	%rcx
	.cfi_def_cfa_offset 32
	leaq	0(%rbp,%rax,4), %rax
	cmpl	$-1, (%rax)
	je	.L231
	cmpl	$-1, 4(%rax)
	jne	.L220
	cmpl	$-1, 8(%rax)
	je	.L232
.L220:
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L219:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	movl	$10, %edi
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	jmp	putchar@PLT
	.p2align 4,,10
	.p2align 3
.L231:
	.cfi_restore_state
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	movl	$10, %edi
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	jmp	putchar@PLT
	.p2align 4,,10
	.p2align 3
.L232:
	.cfi_restore_state
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L219
	.p2align 4,,10
	.p2align 3
.L221:
	movl	$-1, %r8d
	jmp	.L215
	.cfi_endproc
.LFE27:
	.size	printtree, .-printtree
	.section	.rodata.str1.1
.LC4:
	.string	"%d"
.LC6:
	.string	"%d %d %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	n(%rip), %rsi
	leaq	.LC4(%rip), %rdi
	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
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %edx
	testl	%edx, %edx
	jle	.L245
	leal	-1(%rdx), %eax
	cmpl	$2, %eax
	jbe	.L249
	movl	%edx, %eax
	pcmpeqd	%xmm0, %xmm0
	shrl	$2, %eax
	movaps	%xmm0, tree(%rip)
	movaps	%xmm0, 16+tree(%rip)
	movaps	%xmm0, 32+tree(%rip)
	cmpl	$1, %eax
	je	.L236
	movaps	%xmm0, 48+tree(%rip)
	movaps	%xmm0, 64+tree(%rip)
	movaps	%xmm0, 80+tree(%rip)
	cmpl	$2, %eax
	je	.L236
	movaps	%xmm0, 96+tree(%rip)
	movaps	%xmm0, 112+tree(%rip)
	movaps	%xmm0, 128+tree(%rip)
	cmpl	$3, %eax
	je	.L236
	movaps	%xmm0, 144+tree(%rip)
	movaps	%xmm0, 160+tree(%rip)
	movaps	%xmm0, 176+tree(%rip)
	cmpl	$4, %eax
	je	.L236
	movaps	%xmm0, 192+tree(%rip)
	movaps	%xmm0, 208+tree(%rip)
	movaps	%xmm0, 224+tree(%rip)
	cmpl	$5, %eax
	je	.L236
	movaps	%xmm0, 240+tree(%rip)
	movaps	%xmm0, 256+tree(%rip)
	movaps	%xmm0, 272+tree(%rip)
	cmpl	$6, %eax
	je	.L236
	movaps	%xmm0, 288+tree(%rip)
	movaps	%xmm0, 304+tree(%rip)
	movaps	%xmm0, 320+tree(%rip)
.L236:
	movl	%edx, %eax
	andl	$-4, %eax
	testb	$3, %dl
	je	.L237
.L235:
	movslq	%eax, %rcx
	movq	.LC5(%rip), %rdi
	leaq	tree(%rip), %rsi
	leaq	(%rcx,%rcx,2), %rcx
	salq	$2, %rcx
	movl	$-1, 8(%rsi,%rcx)
	movq	%rdi, (%rsi,%rcx)
	leal	1(%rax), %ecx
	cmpl	%ecx, %edx
	jle	.L237
	movslq	%ecx, %rcx
	addl	$2, %eax
	imulq	$12, %rcx, %rcx
	movl	$-1, 8(%rsi,%rcx)
	movq	%rdi, (%rsi,%rcx)
	cmpl	%edx, %eax
	jge	.L237
	cltq
	imulq	$12, %rax, %rax
	movl	$-1, 8(%rsi,%rax)
	movq	%rdi, (%rsi,%rax)
.L237:
	xorl	%ebx, %ebx
	leaq	20(%rsp), %r15
	leaq	16(%rsp), %r14
	leaq	12(%rsp), %r13
	leaq	.LC6(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L242:
	movq	%r15, %rcx
	movq	%r14, %rdx
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	16(%rsp), %rdx
	movslq	20(%rsp), %rax
	leaq	4+tree(%rip), %rdi
	movslq	12(%rsp), %rsi
	movd	%edx, %xmm0
	movd	%eax, %xmm1
	movq	%rsi, %rcx
	punpckldq	%xmm1, %xmm0
	leaq	(%rsi,%rsi,2), %rsi
	movq	%xmm0, (%rdi,%rsi,4)
	cmpl	$-1, %edx
	je	.L238
	leaq	(%rdx,%rdx,2), %rdx
	subq	$4, %rdi
	movl	%ecx, (%rdi,%rdx,4)
.L238:
	cmpl	$-1, %eax
	je	.L239
	leaq	(%rax,%rax,2), %rax
	leaq	tree(%rip), %rsi
	addl	$1, %ebx
	movl	%ecx, (%rsi,%rax,4)
	movl	n(%rip), %ecx
	cmpl	%ecx, %ebx
	jl	.L242
.L241:
	testl	%ecx, %ecx
	jle	.L245
	leaq	tree(%rip), %rdx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L244:
	cmpl	$-1, (%rdx)
	cmove	%eax, %ebp
	addl	$1, %eax
	addq	$12, %rdx
	cmpl	%ecx, %eax
	jne	.L244
.L245:
	xorl	%esi, %esi
	movl	%ebp, %edi
	call	getdip
	movl	%ebp, %edi
	xorl	%eax, %eax
	call	getheight
	movl	n(%rip), %eax
	testl	%eax, %eax
	jle	.L246
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L247:
	movl	%ebx, %edi
	addl	$1, %ebx
	call	printtree
	cmpl	%ebx, n(%rip)
	jg	.L247
.L246:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L274
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L239:
	.cfi_restore_state
	movl	n(%rip), %ecx
	addl	$1, %ebx
	cmpl	%ebx, %ecx
	jg	.L242
	jmp	.L241
.L249:
	xorl	%eax, %eax
	jmp	.L235
.L274:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	height
	.bss
	.align 32
	.type	height, @object
	.size	height, 120
height:
	.zero	120
	.globl	dipth
	.align 32
	.type	dipth, @object
	.size	dipth, 120
dipth:
	.zero	120
	.globl	tree
	.align 32
	.type	tree, @object
	.size	tree, 360
tree:
	.zero	360
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC5:
	.long	-1
	.long	-1
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	getheight
	.type	getheight, @function
getheight:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	tree(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movslq	%edi, %rbx
	leaq	(%rbx,%rbx,2), %rax
	leaq	0(%rbp,%rax,4), %rax
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movl	4(%rax), %edx
	cmpl	$-1, %edx
	jne	.L110
	movl	8(%rax), %edx
	leaq	height(%rip), %r13
	xorl	%eax, %eax
	cmpl	$-1, %edx
	jne	.L111
.L47:
	movl	%eax, 0(%r13,%rbx,4)
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L111:
	.cfi_restore_state
	xorl	%r15d, %r15d
	leaq	height(%rip), %r13
.L46:
	movslq	%edx, %r12
	leaq	(%r12,%r12,2), %rax
	leaq	0(%rbp,%rax,4), %rax
	movl	4(%rax), %edx
	cmpl	$-1, %edx
	je	.L18
	movslq	%edx, %r14
	leaq	(%r14,%r14,2), %rax
	leaq	0(%rbp,%rax,4), %rax
	movslq	4(%rax), %rdx
	cmpl	$-1, %edx
	jne	.L112
	movslq	8(%rax), %rdx
	cmpl	$-1, %edx
	jne	.L82
	movl	$1, %edx
	xorl	%eax, %eax
.L43:
	movl	%eax, 0(%r13,%r14,4)
	leaq	(%r12,%r12,2), %rax
	xorl	%ecx, %ecx
	movl	8(%rbp,%rax,4), %eax
	cmpl	$-1, %eax
	jne	.L38
.L25:
	cmpl	%edx, %ecx
	cmovl	%edx, %ecx
	leal	1(%rcx), %eax
	jmp	.L39
	.p2align 4,,10
	.p2align 3
.L110:
	movslq	%edx, %r12
	leaq	(%r12,%r12,2), %rax
	leaq	0(%rbp,%rax,4), %rax
	movl	4(%rax), %edx
	cmpl	$-1, %edx
	je	.L3
	movslq	%edx, %r14
	leaq	(%r14,%r14,2), %rax
	leaq	0(%rbp,%rax,4), %rax
	movl	4(%rax), %edx
	cmpl	$-1, %edx
	jne	.L113
	movl	8(%rax), %edx
	cmpl	$-1, %edx
	jne	.L90
	movl	$1, %r15d
	xorl	%eax, %eax
	leaq	height(%rip), %r13
.L59:
	movl	%eax, 0(%r13,%r14,4)
	leaq	(%r12,%r12,2), %rax
	movl	8(%rbp,%rax,4), %edx
	xorl	%eax, %eax
	cmpl	$-1, %edx
	jne	.L54
.L10:
	cmpl	%r15d, %eax
	cmovl	%r15d, %eax
	leal	1(%rax), %r15d
	jmp	.L55
	.p2align 4,,10
	.p2align 3
.L18:
	movl	8(%rax), %eax
	cmpl	$-1, %eax
	jne	.L80
	movl	$1, %eax
	xorl	%ecx, %ecx
.L39:
	movl	%ecx, 0(%r13,%r12,4)
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L3:
	movl	8(%rax), %edx
	cmpl	$-1, %edx
	jne	.L88
	movl	$1, %r15d
	xorl	%eax, %eax
	leaq	height(%rip), %r13
.L55:
	movl	%eax, 0(%r13,%r12,4)
	leaq	(%rbx,%rbx,2), %rax
	movl	8(%rbp,%rax,4), %edx
	xorl	%eax, %eax
	cmpl	$-1, %edx
	jne	.L46
.L17:
	cmpl	%r15d, %eax
	cmovl	%r15d, %eax
	jmp	.L47
	.p2align 4,,10
	.p2align 3
.L88:
	xorl	%r15d, %r15d
	leaq	height(%rip), %r13
.L54:
	movslq	%edx, %r14
	leaq	(%r14,%r14,2), %rax
	leaq	0(%rbp,%rax,4), %rax
	movslq	4(%rax), %rdx
	cmpl	$-1, %edx
	je	.L11
	leaq	(%rdx,%rdx,2), %rax
	leaq	0(%rbp,%rax,4), %rsi
	movl	4(%rsi), %edi
	cmpl	$-1, %edi
	je	.L12
	movq	%rdx, 8(%rsp)
	movq	%rsi, (%rsp)
	call	getheight
	movq	(%rsp), %rsi
	movq	8(%rsp), %rdx
	leal	1(%rax), %ecx
	xorl	%eax, %eax
	movl	8(%rsi), %edi
	cmpl	$-1, %edi
	jne	.L52
.L13:
	cmpl	%ecx, %eax
	cmovl	%ecx, %eax
	leal	1(%rax), %esi
.L53:
	movl	%eax, 0(%r13,%rdx,4)
	leaq	(%r14,%r14,2), %rax
	xorl	%ecx, %ecx
	movl	8(%rbp,%rax,4), %eax
	cmpl	$-1, %eax
	je	.L14
.L50:
	movslq	%eax, %rdx
	leaq	(%rdx,%rdx,2), %rax
	leaq	0(%rbp,%rax,4), %r8
	movl	4(%r8), %edi
	cmpl	$-1, %edi
	je	.L15
	movq	%rdx, 16(%rsp)
	movq	%r8, 8(%rsp)
	movl	%esi, (%rsp)
	call	getheight
	movq	8(%rsp), %r8
	movl	(%rsp), %esi
	leal	1(%rax), %ecx
	xorl	%eax, %eax
	movq	16(%rsp), %rdx
	movl	8(%r8), %edi
	cmpl	$-1, %edi
	jne	.L48
.L16:
	cmpl	%ecx, %eax
	cmovl	%ecx, %eax
	leal	1(%rax), %ecx
.L49:
	movl	%eax, 0(%r13,%rdx,4)
.L14:
	cmpl	%esi, %ecx
	cmovl	%esi, %ecx
	leal	1(%rcx), %eax
.L51:
	movl	%ecx, 0(%r13,%r14,4)
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L80:
	xorl	%edx, %edx
.L38:
	movslq	%eax, %r14
	leaq	(%r14,%r14,2), %rax
	leaq	0(%rbp,%rax,4), %rax
	movslq	4(%rax), %rcx
	cmpl	$-1, %ecx
	je	.L26
	leaq	(%rcx,%rcx,2), %rax
	leaq	0(%rbp,%rax,4), %r8
	movl	4(%r8), %edi
	cmpl	$-1, %edi
	je	.L27
	movq	%rcx, 16(%rsp)
	movq	%r8, 8(%rsp)
	movl	%edx, (%rsp)
	call	getheight
	movq	8(%rsp), %r8
	movl	(%rsp), %edx
	leal	1(%rax), %esi
	xorl	%eax, %eax
	movq	16(%rsp), %rcx
	movl	8(%r8), %edi
	cmpl	$-1, %edi
	jne	.L36
.L28:
	cmpl	%esi, %eax
	cmovl	%esi, %eax
	leal	1(%rax), %r8d
.L37:
	movl	%eax, 0(%r13,%rcx,4)
	leaq	(%r14,%r14,2), %rax
	movslq	8(%rbp,%rax,4), %rcx
	xorl	%eax, %eax
	cmpl	$-1, %ecx
	je	.L29
.L34:
	leaq	(%rcx,%rcx,2), %rax
	leaq	0(%rbp,%rax,4), %rsi
	movl	4(%rsi), %edi
	cmpl	$-1, %edi
	je	.L30
	movq	%rcx, 24(%rsp)
	movq	%rsi, 16(%rsp)
	movl	%edx, 8(%rsp)
	movl	%r8d, (%rsp)
	call	getheight
	movq	16(%rsp), %rsi
	movl	(%rsp), %r8d
	movl	8(%rsp), %edx
	movq	24(%rsp), %rcx
	leal	1(%rax), %ebp
	movl	8(%rsi), %edi
	xorl	%esi, %esi
	cmpl	$-1, %edi
	jne	.L32
.L31:
	cmpl	%ebp, %esi
	cmovl	%ebp, %esi
	leal	1(%rsi), %eax
.L33:
	movl	%esi, 0(%r13,%rcx,4)
.L29:
	cmpl	%r8d, %eax
	cmovl	%r8d, %eax
	leal	1(%rax), %ecx
.L35:
	movl	%eax, 0(%r13,%r14,4)
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L113:
	movslq	%edx, %r15
	leaq	(%r15,%r15,2), %rax
	leaq	0(%rbp,%rax,4), %rdx
	movl	4(%rdx), %edi
	cmpl	$-1, %edi
	je	.L5
	movq	%rdx, (%rsp)
	call	getheight
	movq	(%rsp), %rdx
	leal	1(%rax), %r13d
	xorl	%eax, %eax
	movl	8(%rdx), %edi
	cmpl	$-1, %edi
	jne	.L60
.L6:
	cmpl	%r13d, %eax
	cmovl	%r13d, %eax
	leal	1(%rax), %esi
.L61:
	leaq	height(%rip), %r13
	movl	%eax, 0(%r13,%r15,4)
	leaq	(%r14,%r14,2), %rax
	movl	8(%rbp,%rax,4), %edx
	xorl	%eax, %eax
	cmpl	$-1, %edx
	je	.L7
.L58:
	movslq	%edx, %r15
	leaq	(%r15,%r15,2), %rax
	leaq	0(%rbp,%rax,4), %rcx
	movl	4(%rcx), %edi
	cmpl	$-1, %edi
	je	.L8
	movq	%rcx, 8(%rsp)
	movl	%esi, (%rsp)
	call	getheight
	movq	8(%rsp), %rcx
	movl	(%rsp), %esi
	leal	1(%rax), %edx
	movl	8(%rcx), %edi
	xorl	%ecx, %ecx
	cmpl	$-1, %edi
	jne	.L56
.L9:
	cmpl	%edx, %ecx
	cmovl	%edx, %ecx
	leal	1(%rcx), %eax
.L57:
	movl	%ecx, 0(%r13,%r15,4)
.L7:
	cmpl	%esi, %eax
	cmovl	%esi, %eax
	leal	1(%rax), %r15d
	jmp	.L59
	.p2align 4,,10
	.p2align 3
.L112:
	leaq	(%rdx,%rdx,2), %rax
	leaq	0(%rbp,%rax,4), %rsi
	movl	4(%rsi), %edi
	cmpl	$-1, %edi
	je	.L20
	movq	%rdx, 8(%rsp)
	movq	%rsi, (%rsp)
	call	getheight
	movq	(%rsp), %rsi
	movq	8(%rsp), %rdx
	leal	1(%rax), %ecx
	xorl	%eax, %eax
	movl	8(%rsi), %edi
	cmpl	$-1, %edi
	jne	.L44
.L21:
	cmpl	%ecx, %eax
	cmovl	%ecx, %eax
	leal	1(%rax), %esi
.L45:
	movl	%eax, 0(%r13,%rdx,4)
	leaq	(%r14,%r14,2), %rax
	movslq	8(%rbp,%rax,4), %rdx
	xorl	%eax, %eax
	cmpl	$-1, %edx
	je	.L22
.L42:
	leaq	(%rdx,%rdx,2), %rax
	leaq	0(%rbp,%rax,4), %rcx
	movl	4(%rcx), %edi
	cmpl	$-1, %edi
	je	.L23
	movq	%rdx, 16(%rsp)
	movq	%rcx, 8(%rsp)
	movl	%esi, (%rsp)
	call	getheight
	movq	8(%rsp), %rcx
	movl	(%rsp), %esi
	movq	16(%rsp), %rdx
	leal	1(%rax), %r8d
	movl	8(%rcx), %edi
	xorl	%ecx, %ecx
	cmpl	$-1, %edi
	jne	.L40
.L24:
	cmpl	%r8d, %ecx
	cmovl	%r8d, %ecx
	leal	1(%rcx), %eax
.L41:
	movl	%ecx, 0(%r13,%rdx,4)
.L22:
	cmpl	%esi, %eax
	cmovl	%esi, %eax
	leal	1(%rax), %edx
	jmp	.L43
	.p2align 4,,10
	.p2align 3
.L30:
	movl	8(%rsi), %edi
	cmpl	$-1, %edi
	je	.L114
	xorl	%ebp, %ebp
.L32:
	movq	%rcx, 16(%rsp)
	movl	%edx, 8(%rsp)
	movl	%r8d, (%rsp)
	call	getheight
	movq	16(%rsp), %rcx
	movl	8(%rsp), %edx
	movl	(%rsp), %r8d
	leal	1(%rax), %esi
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L27:
	movl	8(%r8), %edi
	cmpl	$-1, %edi
	je	.L115
	xorl	%esi, %esi
.L36:
	movq	%rcx, 16(%rsp)
	movl	%edx, 8(%rsp)
	movl	%esi, (%rsp)
	call	getheight
	movq	16(%rsp), %rcx
	movl	8(%rsp), %edx
	movl	(%rsp), %esi
	addl	$1, %eax
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L15:
	movl	8(%r8), %edi
	cmpl	$-1, %edi
	je	.L116
	xorl	%ecx, %ecx
.L48:
	movq	%rdx, 16(%rsp)
	movl	%esi, 8(%rsp)
	movl	%ecx, (%rsp)
	call	getheight
	movq	16(%rsp), %rdx
	movl	8(%rsp), %esi
	movl	(%rsp), %ecx
	addl	$1, %eax
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L8:
	movl	8(%rcx), %edi
	cmpl	$-1, %edi
	je	.L117
	xorl	%edx, %edx
.L56:
	movl	%esi, 8(%rsp)
	movl	%edx, (%rsp)
	call	getheight
	movl	8(%rsp), %esi
	movl	(%rsp), %edx
	leal	1(%rax), %ecx
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L23:
	movl	8(%rcx), %edi
	cmpl	$-1, %edi
	je	.L118
	xorl	%r8d, %r8d
.L40:
	movq	%rdx, 16(%rsp)
	movl	%esi, 8(%rsp)
	movl	%r8d, (%rsp)
	call	getheight
	movq	16(%rsp), %rdx
	movl	8(%rsp), %esi
	movl	(%rsp), %r8d
	leal	1(%rax), %ecx
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L12:
	movl	8(%rsi), %edi
	cmpl	$-1, %edi
	je	.L119
	xorl	%ecx, %ecx
.L52:
	movq	%rdx, 8(%rsp)
	movl	%ecx, (%rsp)
	call	getheight
	movq	8(%rsp), %rdx
	movl	(%rsp), %ecx
	addl	$1, %eax
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L20:
	movl	8(%rsi), %edi
	cmpl	$-1, %edi
	je	.L120
	xorl	%ecx, %ecx
.L44:
	movq	%rdx, 8(%rsp)
	movl	%ecx, (%rsp)
	call	getheight
	movq	8(%rsp), %rdx
	movl	(%rsp), %ecx
	addl	$1, %eax
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L5:
	movl	8(%rdx), %edi
	cmpl	$-1, %edi
	je	.L121
	xorl	%r13d, %r13d
.L60:
	call	getheight
	addl	$1, %eax
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L26:
	movslq	8(%rax), %rcx
	cmpl	$-1, %ecx
	jne	.L78
	movl	$1, %ecx
	xorl	%eax, %eax
	jmp	.L35
	.p2align 4,,10
	.p2align 3
.L11:
	movl	8(%rax), %eax
	cmpl	$-1, %eax
	jne	.L86
	movl	$1, %eax
	xorl	%ecx, %ecx
	jmp	.L51
	.p2align 4,,10
	.p2align 3
.L86:
	xorl	%esi, %esi
	jmp	.L50
	.p2align 4,,10
	.p2align 3
.L90:
	xorl	%esi, %esi
	leaq	height(%rip), %r13
	jmp	.L58
	.p2align 4,,10
	.p2align 3
.L82:
	xorl	%esi, %esi
	jmp	.L42
	.p2align 4,,10
	.p2align 3
.L78:
	xorl	%r8d, %r8d
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L119:
	movl	$1, %esi
	xorl	%eax, %eax
	jmp	.L53
	.p2align 4,,10
	.p2align 3
.L118:
	movl	$1, %eax
	xorl	%ecx, %ecx
	jmp	.L41
	.p2align 4,,10
	.p2align 3
.L117:
	movl	$1, %eax
	xorl	%ecx, %ecx
	jmp	.L57
	.p2align 4,,10
	.p2align 3
.L120:
	movl	$1, %esi
	xorl	%eax, %eax
	jmp	.L45
	.p2align 4,,10
	.p2align 3
.L121:
	movl	$1, %esi
	xorl	%eax, %eax
	jmp	.L61
	.p2align 4,,10
	.p2align 3
.L116:
	movl	$1, %ecx
	xorl	%eax, %eax
	jmp	.L49
	.p2align 4,,10
	.p2align 3
.L114:
	movl	$1, %eax
	xorl	%esi, %esi
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L115:
	movl	$1, %r8d
	xorl	%eax, %eax
	jmp	.L37
	.cfi_endproc
.LFE24:
	.size	getheight, .-getheight
	.p2align 4
	.globl	getsibling
	.type	getsibling, @function
getsibling:
.LFB25:
	.cfi_startproc
	endbr64
	movslq	%edi, %rax
	leaq	tree(%rip), %rdx
	leaq	(%rax,%rax,2), %rax
	movslq	(%rdx,%rax,4), %rax
	cmpl	$-1, %eax
	je	.L126
	leaq	(%rax,%rax,2), %rcx
	movl	4(%rdx,%rcx,4), %r8d
	cmpl	$-1, %r8d
	je	.L127
	cmpl	%edi, %r8d
	jne	.L122
.L127:
	leaq	(%rax,%rax,2), %rax
	movl	8(%rdx,%rax,4), %r8d
	cmpl	%edi, %r8d
	je	.L126
	cmpl	$-1, %r8d
	je	.L126
.L122:
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L126:
	movl	$-1, %r8d
	jmp	.L122
	.cfi_endproc
.LFE25:
	.size	getsibling, .-getsibling
	.p2align 4
	.globl	getdip
	.type	getdip, @function
getdip:
.LFB26:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%edi, %rax
	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
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movl	%esi, 32(%rsp)
	cmpl	$-1, %eax
	je	.L135
	leaq	dipth(%rip), %r10
	leaq	tree(%rip), %r11
.L155:
	movl	32(%rsp), %edx
	movq	%rax, 24(%rsp)
	movl	%edx, (%r10,%rax,4)
	leaq	(%rax,%rax,2), %rax
	movslq	8(%r11,%rax,4), %rax
	cmpl	$-1, %eax
	je	.L137
	leal	1(%rdx), %ecx
	movl	%ecx, 12(%rsp)
.L154:
	movl	12(%rsp), %edx
	movq	%rax, 16(%rsp)
	movl	%edx, (%r10,%rax,4)
	leaq	(%rax,%rax,2), %rax
	movslq	8(%r11,%rax,4), %rax
	cmpl	$-1, %eax
	je	.L138
	leal	1(%rdx), %ecx
	movl	%ecx, 8(%rsp)
.L153:
	movl	8(%rsp), %edx
	movq	%rax, (%rsp)
	movl	%edx, (%r10,%rax,4)
	leaq	(%rax,%rax,2), %rax
	movl	8(%r11,%rax,4), %ecx
	cmpl	$-1, %ecx
	je	.L139
	leal	1(%rdx), %r9d
.L152:
	movslq	%ecx, %rdx
	leaq	(%rdx,%rdx,2), %rax
	movl	%r9d, (%r10,%rdx,4)
	movslq	8(%r11,%rax,4), %r15
	cmpl	$-1, %r15d
	je	.L140
	leal	1(%r9), %ecx
.L151:
	leaq	(%r15,%r15,2), %rax
	movl	%ecx, (%r10,%r15,4)
	movslq	8(%r11,%rax,4), %r12
	cmpl	$-1, %r12d
	je	.L141
	leal	1(%rcx), %eax
.L150:
	leaq	(%r12,%r12,2), %rsi
	movl	%eax, (%r10,%r12,4)
	movslq	8(%r11,%rsi,4), %rbx
	cmpl	$-1, %ebx
	je	.L142
	leal	1(%rax), %r13d
.L149:
	leaq	(%rbx,%rbx,2), %rsi
	movl	%r13d, (%r10,%rbx,4)
	movslq	8(%r11,%rsi,4), %rbp
	cmpl	$-1, %ebp
	je	.L143
	leal	2(%r13), %r8d
.L148:
	leal	-1(%r8), %esi
	movl	%esi, (%r10,%rbp,4)
	leaq	0(%rbp,%rbp,2), %rsi
	movslq	8(%r11,%rsi,4), %rdi
	cmpl	$-1, %edi
	je	.L144
	movl	%r8d, %esi
.L147:
	movl	%esi, (%r10,%rdi,4)
	leaq	(%rdi,%rdi,2), %rdi
	leaq	(%r11,%rdi,4), %r14
	movl	8(%r14), %edi
	cmpl	$-1, %edi
	je	.L145
	addl	$1, %esi
	movq	%rdx, 56(%rsp)
	movl	%r8d, 52(%rsp)
	movl	%eax, 48(%rsp)
	movl	%ecx, 44(%rsp)
	movl	%r9d, 40(%rsp)
	movl	%esi, 36(%rsp)
	call	getdip
	movslq	4(%r14), %rdi
	movl	36(%rsp), %esi
	leaq	tree(%rip), %r11
	movl	40(%rsp), %r9d
	movl	44(%rsp), %ecx
	leaq	dipth(%rip), %r10
	cmpl	$-1, %edi
	movl	48(%rsp), %eax
	movl	52(%rsp), %r8d
	movq	56(%rsp), %rdx
	jne	.L147
	.p2align 4,,10
	.p2align 3
.L144:
	leaq	0(%rbp,%rbp,2), %rsi
	addl	$1, %r8d
	movslq	4(%r11,%rsi,4), %rbp
	cmpl	$-1, %ebp
	jne	.L148
.L143:
	leaq	(%rbx,%rbx,2), %rsi
	movslq	4(%r11,%rsi,4), %rbx
	cmpl	$-1, %ebx
	je	.L142
	addl	$1, %r13d
	jmp	.L149
	.p2align 4,,10
	.p2align 3
.L145:
	movslq	4(%r14), %rdi
	cmpl	$-1, %edi
	je	.L144
	addl	$1, %esi
	jmp	.L147
	.p2align 4,,10
	.p2align 3
.L142:
	leaq	(%r12,%r12,2), %rsi
	movslq	4(%r11,%rsi,4), %r12
	cmpl	$-1, %r12d
	je	.L141
	addl	$1, %eax
	jmp	.L150
	.p2align 4,,10
	.p2align 3
.L141:
	leaq	(%r15,%r15,2), %rax
	movslq	4(%r11,%rax,4), %r15
	cmpl	$-1, %r15d
	je	.L140
	addl	$1, %ecx
	jmp	.L151
	.p2align 4,,10
	.p2align 3
.L140:
	leaq	(%rdx,%rdx,2), %rax
	movl	4(%r11,%rax,4), %ecx
	cmpl	$-1, %ecx
	je	.L139
	addl	$1, %r9d
	jmp	.L152
.L139:
	movq	(%rsp), %rax
	leaq	(%rax,%rax,2), %rax
	movslq	4(%r11,%rax,4), %rax
	cmpl	$-1, %eax
	je	.L138
	addl	$1, 8(%rsp)
	jmp	.L153
.L138:
	movq	16(%rsp), %rax
	leaq	(%rax,%rax,2), %rax
	movslq	4(%r11,%rax,4), %rax
	cmpl	$-1, %eax
	je	.L137
	addl	$1, 12(%rsp)
	jmp	.L154
.L137:
	movq	24(%rsp), %rax
	leaq	(%rax,%rax,2), %rax
	movslq	4(%r11,%rax,4), %rax
	cmpl	$-1, %eax
	je	.L135
	addl	$1, 32(%rsp)
	jmp	.L155
.L135:
	addq	$72, %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
.LFE26:
	.size	getdip, .-getdip
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, "
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"root"
.LC2:
	.string	"leaf"
.LC3:
	.string	"internal node"
	.text
	.p2align 4
	.globl	printtree
	.type	printtree, @function
printtree:
.LFB27:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	tree(%rip), %rbp
	xorl	%r9d, %r9d
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movslq	%edi, %rbx
	leaq	(%rbx,%rbx,2), %rax
	movq	%rbx, %rdx
	leaq	0(%rbp,%rax,4), %rax
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	cmpl	$-1, 8(%rax)
	setne	%r9b
	xorl	%ecx, %ecx
	cmpl	$-1, 4(%rax)
	setne	%cl
	addl	%ecx, %r9d
	leaq	height(%rip), %rcx
	movl	(%rcx,%rbx,4), %edi
	leaq	dipth(%rip), %rcx
	movl	(%rcx,%rbx,4), %esi
	movl	(%rax), %ecx
	cmpl	$-1, %ecx
	je	.L221
	movslq	%ecx, %rax
	leaq	(%rax,%rax,2), %r8
	movl	4(%rbp,%r8,4), %r8d
	cmpl	$-1, %r8d
	je	.L222
	cmpl	%r8d, %ebx
	jne	.L215
.L222:
	leaq	(%rax,%rax,2), %rax
	movl	8(%rbp,%rax,4), %r8d
	cmpl	$-1, %r8d
	je	.L221
	cmpl	%r8d, %edx
	je	.L221
.L215:
	pushq	%rdi
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	movl	$1, %edi
	pushq	%rsi
	.cfi_def_cfa_offset 48
	leaq	.LC0(%rip), %rsi
	call	__printf_chk@PLT
	leaq	(%rbx,%rbx,2), %rax
	popq	%rdx
	.cfi_def_cfa_offset 40
	popq	%rcx
	.cfi_def_cfa_offset 32
	leaq	0(%rbp,%rax,4), %rax
	cmpl	$-1, (%rax)
	je	.L231
	cmpl	$-1, 4(%rax)
	jne	.L220
	cmpl	$-1, 8(%rax)
	je	.L232
.L220:
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L219:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	movl	$10, %edi
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	jmp	putchar@PLT
	.p2align 4,,10
	.p2align 3
.L231:
	.cfi_restore_state
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	movl	$10, %edi
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	jmp	putchar@PLT
	.p2align 4,,10
	.p2align 3
.L232:
	.cfi_restore_state
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L219
	.p2align 4,,10
	.p2align 3
.L221:
	movl	$-1, %r8d
	jmp	.L215
	.cfi_endproc
.LFE27:
	.size	printtree, .-printtree
	.section	.rodata.str1.1
.LC4:
	.string	"%d"
.LC6:
	.string	"%d %d %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	n(%rip), %rsi
	leaq	.LC4(%rip), %rdi
	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
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %edx
	testl	%edx, %edx
	jle	.L245
	leal	-1(%rdx), %eax
	cmpl	$2, %eax
	jbe	.L249
	movl	%edx, %eax
	pcmpeqd	%xmm0, %xmm0
	shrl	$2, %eax
	movaps	%xmm0, tree(%rip)
	movaps	%xmm0, 16+tree(%rip)
	movaps	%xmm0, 32+tree(%rip)
	cmpl	$1, %eax
	je	.L236
	movaps	%xmm0, 48+tree(%rip)
	movaps	%xmm0, 64+tree(%rip)
	movaps	%xmm0, 80+tree(%rip)
	cmpl	$2, %eax
	je	.L236
	movaps	%xmm0, 96+tree(%rip)
	movaps	%xmm0, 112+tree(%rip)
	movaps	%xmm0, 128+tree(%rip)
	cmpl	$3, %eax
	je	.L236
	movaps	%xmm0, 144+tree(%rip)
	movaps	%xmm0, 160+tree(%rip)
	movaps	%xmm0, 176+tree(%rip)
	cmpl	$4, %eax
	je	.L236
	movaps	%xmm0, 192+tree(%rip)
	movaps	%xmm0, 208+tree(%rip)
	movaps	%xmm0, 224+tree(%rip)
	cmpl	$5, %eax
	je	.L236
	movaps	%xmm0, 240+tree(%rip)
	movaps	%xmm0, 256+tree(%rip)
	movaps	%xmm0, 272+tree(%rip)
	cmpl	$6, %eax
	je	.L236
	movaps	%xmm0, 288+tree(%rip)
	movaps	%xmm0, 304+tree(%rip)
	movaps	%xmm0, 320+tree(%rip)
.L236:
	movl	%edx, %eax
	andl	$-4, %eax
	testb	$3, %dl
	je	.L237
.L235:
	movslq	%eax, %rcx
	movq	.LC5(%rip), %rdi
	leaq	tree(%rip), %rsi
	leaq	(%rcx,%rcx,2), %rcx
	salq	$2, %rcx
	movl	$-1, 8(%rsi,%rcx)
	movq	%rdi, (%rsi,%rcx)
	leal	1(%rax), %ecx
	cmpl	%ecx, %edx
	jle	.L237
	movslq	%ecx, %rcx
	addl	$2, %eax
	imulq	$12, %rcx, %rcx
	movl	$-1, 8(%rsi,%rcx)
	movq	%rdi, (%rsi,%rcx)
	cmpl	%edx, %eax
	jge	.L237
	cltq
	imulq	$12, %rax, %rax
	movl	$-1, 8(%rsi,%rax)
	movq	%rdi, (%rsi,%rax)
.L237:
	xorl	%ebx, %ebx
	leaq	20(%rsp), %r15
	leaq	16(%rsp), %r14
	leaq	12(%rsp), %r13
	leaq	.LC6(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L242:
	movq	%r15, %rcx
	movq	%r14, %rdx
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	16(%rsp), %rdx
	movslq	20(%rsp), %rax
	leaq	4+tree(%rip), %rdi
	movslq	12(%rsp), %rsi
	movd	%edx, %xmm0
	movd	%eax, %xmm1
	movq	%rsi, %rcx
	punpckldq	%xmm1, %xmm0
	leaq	(%rsi,%rsi,2), %rsi
	movq	%xmm0, (%rdi,%rsi,4)
	cmpl	$-1, %edx
	je	.L238
	leaq	(%rdx,%rdx,2), %rdx
	subq	$4, %rdi
	movl	%ecx, (%rdi,%rdx,4)
.L238:
	cmpl	$-1, %eax
	je	.L239
	leaq	(%rax,%rax,2), %rax
	leaq	tree(%rip), %rsi
	addl	$1, %ebx
	movl	%ecx, (%rsi,%rax,4)
	movl	n(%rip), %ecx
	cmpl	%ecx, %ebx
	jl	.L242
.L241:
	testl	%ecx, %ecx
	jle	.L245
	leaq	tree(%rip), %rdx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L244:
	cmpl	$-1, (%rdx)
	cmove	%eax, %ebp
	addl	$1, %eax
	addq	$12, %rdx
	cmpl	%ecx, %eax
	jne	.L244
.L245:
	xorl	%esi, %esi
	movl	%ebp, %edi
	call	getdip
	movl	%ebp, %edi
	xorl	%eax, %eax
	call	getheight
	movl	n(%rip), %eax
	testl	%eax, %eax
	jle	.L246
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L247:
	movl	%ebx, %edi
	addl	$1, %ebx
	call	printtree
	cmpl	%ebx, n(%rip)
	jg	.L247
.L246:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L274
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L239:
	.cfi_restore_state
	movl	n(%rip), %ecx
	addl	$1, %ebx
	cmpl	%ebx, %ecx
	jg	.L242
	jmp	.L241
.L249:
	xorl	%eax, %eax
	jmp	.L235
.L274:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	height
	.bss
	.align 32
	.type	height, @object
	.size	height, 120
height:
	.zero	120
	.globl	dipth
	.align 32
	.type	dipth, @object
	.size	dipth, 120
dipth:
	.zero	120
	.globl	tree
	.align 32
	.type	tree, @object
	.size	tree, 360
tree:
	.zero	360
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC5:
	.long	-1
	.long	-1
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>
struct Node {
  int parent;
  int left;
  int right;
};
int n;
struct Node tree[30];
int dipth[30],height[30];
void getdip(int,int);
int gettree(int);
int getsibling(int);
void printtree(int);
int main(){
  int i,id,left,right,root;
  scanf("%d",&n);
  for(i=0;i<n;i++)tree[i].parent=tree[i].left=tree[i].right=-1;
  for(i=0;i<n;i++){
    scanf("%d %d %d",&id,&left,&right);
    tree[id].left=left;
    tree[id].right=right;
    if(left!=-1)tree[left].parent=id;
    if(right!=-1)tree[right].parent=id;
  }
  for(i=0;i<n;i++){
    if(tree[i].parent==-1)root=i;
  }
  getdip(root,0);
  getheight(root);
  for(i=0;i<n;i++)printtree(i);
  return 0;
}
int getheight(int root){
  int h1=0,h2=0;
  if(tree[root].left!=-1)h1=getheight(tree[root].left)+1;
  if(tree[root].right!=-1)h2=getheight(tree[root].right)+1;
  if(h1>h2)height[root]=h1;
  else height[root]=h2;
  return height[root];
}
int getsibling(int num){
  if(tree[num].parent==-1)return -1;
  if(tree[tree[num].parent].left!=num&&tree[tree[num].parent].left!=-1)return tree[tree[num]\
.parent].left;
  else if(tree[tree[num].parent].right!=num&&tree[tree[num].parent].right!=-1)return tree[tr\
ee[num].parent].right;
  return -1;
}
void getdip(int r,int d){
  if(r==-1)return;
  dipth[r]=d;
  if(tree[r].right!=-1)getdip(tree[r].right,d+1);
  if(tree[r].left!=-1)getdip(tree[r].left,d+1);
}
void printtree(int i){
  int m,j=0,digree=0;
  if(tree[i].right!=-1)digree++;
  if(tree[i].left!=-1)digree++;
  printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, ",i,tree\
[i].parent,getsibling(i),digree,dipth[i],height[i]);
  if(tree[i].parent==-1)printf("root");
  else if(tree[i].left==-1&&tree[i].right==-1)printf("leaf");
  else printf("internal node");
  printf("\n");
}


9
0 1 4
1 2 3
2 -1 -1
3 -1 -1
4 5 8
5 6 7
6 -1 -1
7 -1 -1
8 -1 -1
 9
0 1 4
1 2 3
2 -1 -1
3 -1 -1
4 5 8
5 6 7
6 -1 -1
7 -1 -1
8 -1 -1

node 0: parent = -1, sibling = -1, degree = 2, depth = 0, height = 3, root
node 1: parent = 0, sibling = 4, degree = 2, depth = 1, height = 1, internal node
node 2: parent = 1, sibling = 3, degree = 0, depth = 2, height = 0, leaf
node 3: parent = 1, sibling = 2, degree = 0, depth = 2, height = 0, leaf
node 4: parent = 0, sibling = 1, degree = 2, depth = 1, height = 2, internal node
node 5: parent = 4, sibling = 8, degree = 2, depth = 2, height = 1, internal node
node 6: parent = 5, sibling = 7, degree = 0, depth = 3, height = 0, leaf
node 7: parent = 5, sibling = 6, degree = 0, depth = 3, height = 0, leaf
node 8: parent = 4, sibling = 5, degree = 0, depth = 2, height = 0, leaf
 node 0: parent = -1, sibling = -1, degree = 2, depth = 0, height = 3, root
node 1: parent = 0, sibling = 4, degree = 2, depth = 1, height = 1, internal node
node 2: parent = 1, sibling = 3, degree = 0, depth = 2, height = 0, leaf
node 3: parent = 1, sibling = 2, degree = 0, depth = 2, height = 0, leaf
node 4: parent = 0, sibling = 1, degree = 2, depth = 1, height = 2, internal node
node 5: parent = 4, sibling = 8, degree = 2, depth = 2, height = 1, internal node
node 6: parent = 5, sibling = 7, degree = 0, depth = 3, height = 0, leaf
node 7: parent = 5, sibling = 6, degree = 0, depth = 3, height = 0, leaf
node 8: parent = 4, sibling = 5, degree = 0, depth = 2, height = 0, 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>
struct Node {
  int parent;
  int left;
  int right;
};
int n;
struct Node tree[30];
int dipth[30],height[30];
void getdip(int,int);
int gettree(int);
int getsibling(int);
void printtree(int);
int main(){
  int i,id,left,right,root;
  scanf("%d",&n);
  for(i=0;i<n;i++)tree[i].parent=tree[i].left=tree[i].right=-1;
  for(i=0;i<n;i++){
    scanf("%d %d %d",&id,&left,&right);
    tree[id].left=left;
    tree[id].right=right;
    if(left!=-1)tree[left].parent=id;
    if(right!=-1)tree[right].parent=id;
  }
  for(i=0;i<n;i++){
    if(tree[i].parent==-1)root=i;
  }
  getdip(root,0);
  getheight(root);
  for(i=0;i<n;i++)printtree(i);
  return 0;
}
int getheight(int root){
  int h1=0,h2=0;
  if(tree[root].left!=-1)h1=getheight(tree[root].left)+1;
  if(tree[root].right!=-1)h2=getheight(tree[root].right)+1;
  if(h1>h2)height[root]=h1;
  else height[root]=h2;
  return height[root];
}
int getsibling(int num){
  if(tree[num].parent==-1)return -1;
  if(tree[tree[num].parent].left!=num&&tree[tree[num].parent].left!=-1)return tree[tree[num]\
.parent].left;
  else if(tree[tree[num].parent].right!=num&&tree[tree[num].parent].right!=-1)return tree[tr\
ee[num].parent].right;
  return -1;
}
void getdip(int r,int d){
  if(r==-1)return;
  dipth[r]=d;
  if(tree[r].right!=-1)getdip(tree[r].right,d+1);
  if(tree[r].left!=-1)getdip(tree[r].left,d+1);
}
void printtree(int i){
  int m,j=0,digree=0;
  if(tree[i].right!=-1)digree++;
  if(tree[i].left!=-1)digree++;
  printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, ",i,tree\
[i].parent,getsibling(i),digree,dipth[i],height[i]);
  if(tree[i].parent==-1)printf("root");
  else if(tree[i].left==-1&&tree[i].right==-1)printf("leaf");
  else printf("internal node");
  printf("\n");
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	tree
	.align 32
	.type	tree, @object
	.size	tree, 360
tree:
	.zero	360
	.globl	dipth
	.align 32
	.type	dipth, @object
	.size	dipth, 120
dipth:
	.zero	120
	.globl	height
	.align 32
	.type	height, @object
	.size	height, 120
height:
	.zero	120
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -16(%rbp)
	jmp	.L2
.L3:
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+tree(%rip), %rax
	movl	$-1, (%rdx,%rax)
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+tree(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	4+tree(%rip), %rax
	movl	%edx, (%rcx,%rax)
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+tree(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	tree(%rip), %rax
	movl	%edx, (%rcx,%rax)
	addl	$1, -16(%rbp)
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L3
	movl	$0, -16(%rbp)
	jmp	.L4
.L7:
	leaq	-20(%rbp), %rcx
	leaq	-24(%rbp), %rdx
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	movl	-24(%rbp), %edx
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	4+tree(%rip), %rax
	movl	%edx, (%rcx,%rax)
	movl	-28(%rbp), %eax
	movl	-20(%rbp), %edx
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	8+tree(%rip), %rax
	movl	%edx, (%rcx,%rax)
	movl	-24(%rbp), %eax
	cmpl	$-1, %eax
	je	.L5
	movl	-24(%rbp), %eax
	movl	-28(%rbp), %edx
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	tree(%rip), %rax
	movl	%edx, (%rcx,%rax)
.L5:
	movl	-20(%rbp), %eax
	cmpl	$-1, %eax
	je	.L6
	movl	-20(%rbp), %eax
	movl	-28(%rbp), %edx
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	tree(%rip), %rax
	movl	%edx, (%rcx,%rax)
.L6:
	addl	$1, -16(%rbp)
.L4:
	movl	n(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L7
	movl	$0, -16(%rbp)
	jmp	.L8
.L10:
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	jne	.L9
	movl	-16(%rbp), %eax
	movl	%eax, -12(%rbp)
.L9:
	addl	$1, -16(%rbp)
.L8:
	movl	n(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L10
	movl	-12(%rbp), %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	getdip
	movl	-12(%rbp), %eax
	movl	%eax, %edi
	movl	$0, %eax
	call	getheight
	movl	$0, -16(%rbp)
	jmp	.L11
.L12:
	movl	-16(%rbp), %eax
	movl	%eax, %edi
	call	printtree
	addl	$1, -16(%rbp)
.L11:
	movl	n(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L12
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	getheight
	.type	getheight, @function
getheight:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	$0, -8(%rbp)
	movl	$0, -4(%rbp)
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L16
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %edi
	call	getheight
	addl	$1, %eax
	movl	%eax, -8(%rbp)
.L16:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L17
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %edi
	call	getheight
	addl	$1, %eax
	movl	%eax, -4(%rbp)
.L17:
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jle	.L18
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	height(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L19
.L18:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	height(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L19:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	height(%rip), %rax
	movl	(%rdx,%rax), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	getheight, .-getheight
	.globl	getsibling
	.type	getsibling, @function
getsibling:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	jne	.L22
	movl	$-1, %eax
	jmp	.L23
.L22:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	je	.L24
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L24
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L23
.L24:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	je	.L25
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L25
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L23
.L25:
	movl	$-1, %eax
.L23:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	getsibling, .-getsibling
	.globl	getdip
	.type	getdip, @function
getdip:
.LFB3:
	.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)
	cmpl	$-1, -4(%rbp)
	je	.L30
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	dipth(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L29
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	8+tree(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	getdip
.L29:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L26
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	4+tree(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	getdip
	jmp	.L26
.L30:
	nop
.L26:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	getdip, .-getdip
	.section	.rodata
	.align 8
.LC2:
	.string	"node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, "
.LC3:
	.string	"root"
.LC4:
	.string	"leaf"
.LC5:
	.string	"internal node"
	.text
	.globl	printtree
	.type	printtree, @function
printtree:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset 12, -24
	.cfi_offset 3, -32
	movl	%edi, -36(%rbp)
	movl	$0, -20(%rbp)
	movl	$0, -24(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L32
	addl	$1, -24(%rbp)
.L32:
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L33
	addl	$1, -24(%rbp)
.L33:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	height(%rip), %rax
	movl	(%rdx,%rax), %ebx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dipth(%rip), %rax
	movl	(%rdx,%rax), %r12d
	movl	-36(%rbp), %eax
	movl	%eax, %edi
	call	getsibling
	movl	%eax, %ecx
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	tree(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %esi
	movl	-36(%rbp), %eax
	subq	$8, %rsp
	pushq	%rbx
	movl	%r12d, %r9d
	movl	%esi, %r8d
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addq	$16, %rsp
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	jne	.L34
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L35
.L34:
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	jne	.L36
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	jne	.L36
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L35
.L36:
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L35:
	movl	$10, %edi
	call	putchar@PLT
	nop
	leaq	-16(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	printtree, .-printtree
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	tree
	.align 32
	.type	tree, @object
	.size	tree, 360
tree:
	.zero	360
	.globl	dipth
	.align 32
	.type	dipth, @object
	.size	dipth, 120
dipth:
	.zero	120
	.globl	height
	.align 32
	.type	height, @object
	.size	height, 120
height:
	.zero	120
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -16(%rbp)
	jmp	.L2
.L3:
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+tree(%rip), %rax
	movl	$-1, (%rdx,%rax)
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+tree(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	4+tree(%rip), %rax
	movl	%edx, (%rcx,%rax)
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+tree(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	tree(%rip), %rax
	movl	%edx, (%rcx,%rax)
	addl	$1, -16(%rbp)
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L3
	movl	$0, -16(%rbp)
	jmp	.L4
.L7:
	leaq	-20(%rbp), %rcx
	leaq	-24(%rbp), %rdx
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	movl	-24(%rbp), %edx
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	4+tree(%rip), %rax
	movl	%edx, (%rcx,%rax)
	movl	-28(%rbp), %eax
	movl	-20(%rbp), %edx
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	8+tree(%rip), %rax
	movl	%edx, (%rcx,%rax)
	movl	-24(%rbp), %eax
	cmpl	$-1, %eax
	je	.L5
	movl	-24(%rbp), %eax
	movl	-28(%rbp), %edx
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	tree(%rip), %rax
	movl	%edx, (%rcx,%rax)
.L5:
	movl	-20(%rbp), %eax
	cmpl	$-1, %eax
	je	.L6
	movl	-20(%rbp), %eax
	movl	-28(%rbp), %edx
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	tree(%rip), %rax
	movl	%edx, (%rcx,%rax)
.L6:
	addl	$1, -16(%rbp)
.L4:
	movl	n(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L7
	movl	$0, -16(%rbp)
	jmp	.L8
.L10:
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	jne	.L9
	movl	-16(%rbp), %eax
	movl	%eax, -12(%rbp)
.L9:
	addl	$1, -16(%rbp)
.L8:
	movl	n(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L10
	movl	-12(%rbp), %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	getdip
	movl	-12(%rbp), %eax
	movl	%eax, %edi
	movl	$0, %eax
	call	getheight
	movl	$0, -16(%rbp)
	jmp	.L11
.L12:
	movl	-16(%rbp), %eax
	movl	%eax, %edi
	call	printtree
	addl	$1, -16(%rbp)
.L11:
	movl	n(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L12
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	getheight
	.type	getheight, @function
getheight:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	$0, -8(%rbp)
	movl	$0, -4(%rbp)
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L16
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %edi
	call	getheight
	addl	$1, %eax
	movl	%eax, -8(%rbp)
.L16:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L17
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %edi
	call	getheight
	addl	$1, %eax
	movl	%eax, -4(%rbp)
.L17:
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jle	.L18
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	height(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L19
.L18:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	height(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L19:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	height(%rip), %rax
	movl	(%rdx,%rax), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	getheight, .-getheight
	.globl	getsibling
	.type	getsibling, @function
getsibling:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	jne	.L22
	movl	$-1, %eax
	jmp	.L23
.L22:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	je	.L24
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L24
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L23
.L24:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	je	.L25
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L25
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L23
.L25:
	movl	$-1, %eax
.L23:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	getsibling, .-getsibling
	.globl	getdip
	.type	getdip, @function
getdip:
.LFB3:
	.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)
	cmpl	$-1, -4(%rbp)
	je	.L30
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	dipth(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L29
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	8+tree(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	getdip
.L29:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L26
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	4+tree(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	getdip
	jmp	.L26
.L30:
	nop
.L26:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	getdip, .-getdip
	.section	.rodata
	.align 8
.LC2:
	.string	"node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, "
.LC3:
	.string	"root"
.LC4:
	.string	"leaf"
.LC5:
	.string	"internal node"
	.text
	.globl	printtree
	.type	printtree, @function
printtree:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset 12, -24
	.cfi_offset 3, -32
	movl	%edi, -36(%rbp)
	movl	$0, -20(%rbp)
	movl	$0, -24(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L32
	addl	$1, -24(%rbp)
.L32:
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L33
	addl	$1, -24(%rbp)
.L33:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	height(%rip), %rax
	movl	(%rdx,%rax), %ebx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dipth(%rip), %rax
	movl	(%rdx,%rax), %r12d
	movl	-36(%rbp), %eax
	movl	%eax, %edi
	call	getsibling
	movl	%eax, %ecx
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	tree(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %esi
	movl	-36(%rbp), %eax
	subq	$8, %rsp
	pushq	%rbx
	movl	%r12d, %r9d
	movl	%esi, %r8d
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addq	$16, %rsp
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	jne	.L34
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L35
.L34:
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	jne	.L36
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+tree(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	jne	.L36
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L35
.L36:
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L35:
	movl	$10, %edi
	call	putchar@PLT
	nop
	leaq	-16(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	printtree, .-printtree
	.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:
