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

```c
#include<stdio.h>
#include<stdlib.h>


struct node{
  struct node *right;
  struct node *left;
  struct node *parent;
  int key;
};
typedef struct node * Node;
#define NIL NULL

Node root;

Node treeMinimum(Node x){
  while(x->left!=NIL)
    x=x->left;
  return x;

}
Node treeMaximum(Node x){
  while(x->right!=NIL)
    x=x->right;
  return x;

}


Node treeSearch(Node u, int k){
  while(u!=NIL&&k!=u->key){
    if(k<u->key)u=u->left;
    else u=u->right;
  }
  return u;
}

Node treeSuccessor(Node x){
  Node y;
  if(x->right!=NIL)return treeMinimum(x->right);
  y=x->parent;
   while(y!=NIL&&x==y->right){
    x=y;
    y=y->parent;
  }
  return y;
}

void treeDelete(Node z){
  Node y; // node to be deleted
  Node x; // child of y
  if(z->left==NIL||z->right==NIL)y=z;
  else y=treeSuccessor(z);

  if(y->left!=NIL){
    x=y->left;
  }else{
    x=y->right;
  }

  if(x!=NIL){
    x->parent=y->parent;
  }

  if(y->parent==NIL){
    root=x;
  }else{
    if(y==y->parent->left){
      y->parent->left=x;
    }else{
      y->parent->right=x;
    }
  }

  if(y!=z){
    z->key=y->key;
  }
  free(y);
}

void insert(int k){
  Node y = NIL;
  Node x = root;
  Node z;

  z = malloc(sizeof(struct node));
  z->key = k;
  z->left = NIL;
  z->right = NIL;

  while(x!=NIL){
    y=x;
    if(z->key < x->key){
      x=x->left;
    }else{
      x=x->right;
    }
  }
  z->parent = y;
  if(y==NIL){
    root=z;
  }else{
    if(z->key < y->key){
      y->left=z;
    }else{
      y->right=z;
    }
  }
}

void inorder(Node u){
  if(u==NIL)return;
  inorder(u->left);
  printf(" %d",u->key);
  inorder(u->right);
}
void preorder(Node u){
  if(u==NIL)return;
  printf(" %d",u->key);
  preorder(u->left);
  preorder(u->right);
}


int main(){
  int n, i, x;
  char com[20];
  scanf("%d", &n);

  for ( i = 0; i < n; i++ ){
    scanf("%s", com);
    if ( com[0] == 'f' ){
      scanf("%d", &x);
      Node t = treeSearch(root, x);
      if ( t != NIL ) printf("yes\n");
      else printf("no\n");
    } else if ( com[0] == 'i' ){
      scanf("%d", &x);
      insert(x);
    } else if ( com[0] == 'p' ){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    } else if ( com[0] == 'd' ){
      scanf("%d", &x);
      treeDelete(treeSearch(root, x));
    }
  }

  return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	root
	.bss
	.align 8
	.type	root, @object
	.size	root, 8
root:
	.zero	8
	.text
	.globl	treeMinimum
	.type	treeMinimum, @function
treeMinimum:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	jmp	.L2
.L3:
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -8(%rbp)
.L2:
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	testq	%rax, %rax
	jne	.L3
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	treeMinimum, .-treeMinimum
	.globl	treeMaximum
	.type	treeMaximum, @function
treeMaximum:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	jmp	.L6
.L7:
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
.L6:
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	jne	.L7
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	treeMaximum, .-treeMaximum
	.globl	treeSearch
	.type	treeSearch, @function
treeSearch:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	jmp	.L10
.L13:
	movq	-8(%rbp), %rax
	movl	24(%rax), %eax
	cmpl	%eax, -12(%rbp)
	jge	.L11
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -8(%rbp)
	jmp	.L10
.L11:
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
.L10:
	cmpq	$0, -8(%rbp)
	je	.L12
	movq	-8(%rbp), %rax
	movl	24(%rax), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L13
.L12:
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	treeSearch, .-treeSearch
	.globl	treeSuccessor
	.type	treeSuccessor, @function
treeSuccessor:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$24, %rsp
	movq	%rdi, -24(%rbp)
	movq	-24(%rbp), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	.L16
	movq	-24(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, %rdi
	call	treeMinimum
	jmp	.L17
.L16:
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, -8(%rbp)
	jmp	.L18
.L20:
	movq	-8(%rbp), %rax
	movq	%rax, -24(%rbp)
	movq	-8(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, -8(%rbp)
.L18:
	cmpq	$0, -8(%rbp)
	je	.L19
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, -24(%rbp)
	je	.L20
.L19:
	movq	-8(%rbp), %rax
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	treeSuccessor, .-treeSuccessor
	.globl	treeDelete
	.type	treeDelete, @function
treeDelete:
.LFB10:
	.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	%rdi, -24(%rbp)
	movq	-24(%rbp), %rax
	movq	8(%rax), %rax
	testq	%rax, %rax
	je	.L22
	movq	-24(%rbp), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	jne	.L23
.L22:
	movq	-24(%rbp), %rax
	movq	%rax, -16(%rbp)
	jmp	.L24
.L23:
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	treeSuccessor
	movq	%rax, -16(%rbp)
.L24:
	movq	-16(%rbp), %rax
	movq	8(%rax), %rax
	testq	%rax, %rax
	je	.L25
	movq	-16(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -8(%rbp)
	jmp	.L26
.L25:
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
.L26:
	cmpq	$0, -8(%rbp)
	je	.L27
	movq	-16(%rbp), %rax
	movq	16(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 16(%rax)
.L27:
	movq	-16(%rbp), %rax
	movq	16(%rax), %rax
	testq	%rax, %rax
	jne	.L28
	movq	-8(%rbp), %rax
	movq	%rax, root(%rip)
	jmp	.L29
.L28:
	movq	-16(%rbp), %rax
	movq	16(%rax), %rax
	movq	8(%rax), %rax
	cmpq	%rax, -16(%rbp)
	jne	.L30
	movq	-16(%rbp), %rax
	movq	16(%rax), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, 8(%rax)
	jmp	.L29
.L30:
	movq	-16(%rbp), %rax
	movq	16(%rax), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, (%rax)
.L29:
	movq	-16(%rbp), %rax
	cmpq	-24(%rbp), %rax
	je	.L31
	movq	-16(%rbp), %rax
	movl	24(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, 24(%rax)
.L31:
	movq	-16(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	treeDelete, .-treeDelete
	.globl	insert
	.type	insert, @function
insert:
.LFB11:
	.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
	movl	%edi, -36(%rbp)
	movq	$0, -24(%rbp)
	movq	root(%rip), %rax
	movq	%rax, -16(%rbp)
	movl	$32, %edi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movl	-36(%rbp), %edx
	movl	%edx, 24(%rax)
	movq	-8(%rbp), %rax
	movq	$0, 8(%rax)
	movq	-8(%rbp), %rax
	movq	$0, (%rax)
	jmp	.L33
.L35:
	movq	-16(%rbp), %rax
	movq	%rax, -24(%rbp)
	movq	-8(%rbp), %rax
	movl	24(%rax), %edx
	movq	-16(%rbp), %rax
	movl	24(%rax), %eax
	cmpl	%eax, %edx
	jge	.L34
	movq	-16(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -16(%rbp)
	jmp	.L33
.L34:
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
.L33:
	cmpq	$0, -16(%rbp)
	jne	.L35
	movq	-8(%rbp), %rax
	movq	-24(%rbp), %rdx
	movq	%rdx, 16(%rax)
	cmpq	$0, -24(%rbp)
	jne	.L36
	movq	-8(%rbp), %rax
	movq	%rax, root(%rip)
	jmp	.L39
.L36:
	movq	-8(%rbp), %rax
	movl	24(%rax), %edx
	movq	-24(%rbp), %rax
	movl	24(%rax), %eax
	cmpl	%eax, %edx
	jge	.L38
	movq	-24(%rbp), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, 8(%rax)
	jmp	.L39
.L38:
	movq	-24(%rbp), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, (%rax)
.L39:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	insert, .-insert
	.section	.rodata
.LC0:
	.string	" %d"
	.text
	.globl	inorder
	.type	inorder, @function
inorder:
.LFB12:
	.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
	movq	%rdi, -8(%rbp)
	cmpq	$0, -8(%rbp)
	je	.L43
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, %rdi
	call	inorder
	movq	-8(%rbp), %rax
	movl	24(%rax), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, %rdi
	call	inorder
	jmp	.L40
.L43:
	nop
.L40:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	inorder, .-inorder
	.globl	preorder
	.type	preorder, @function
preorder:
.LFB13:
	.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
	movq	%rdi, -8(%rbp)
	cmpq	$0, -8(%rbp)
	je	.L47
	movq	-8(%rbp), %rax
	movl	24(%rax), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, %rdi
	call	preorder
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, %rdi
	call	preorder
	jmp	.L44
.L47:
	nop
.L44:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	preorder, .-preorder
	.section	.rodata
.LC1:
	.string	"%d"
.LC2:
	.string	"%s"
.LC3:
	.string	"yes"
.LC4:
	.string	"no"
	.text
	.globl	main
	.type	main, @function
main:
.LFB14:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-52(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -44(%rbp)
	jmp	.L49
.L55:
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzbl	-32(%rbp), %eax
	cmpb	$102, %al
	jne	.L50
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %edx
	movq	root(%rip), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	treeSearch
	movq	%rax, -40(%rbp)
	cmpq	$0, -40(%rbp)
	je	.L51
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L52
.L51:
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L52
.L50:
	movzbl	-32(%rbp), %eax
	cmpb	$105, %al
	jne	.L53
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %eax
	movl	%eax, %edi
	call	insert
	jmp	.L52
.L53:
	movzbl	-32(%rbp), %eax
	cmpb	$112, %al
	jne	.L54
	movq	root(%rip), %rax
	movq	%rax, %rdi
	call	inorder
	movl	$10, %edi
	call	putchar@PLT
	movq	root(%rip), %rax
	movq	%rax, %rdi
	call	preorder
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L52
.L54:
	movzbl	-32(%rbp), %eax
	cmpb	$100, %al
	jne	.L52
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %edx
	movq	root(%rip), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	treeSearch
	movq	%rax, %rdi
	call	treeDelete
.L52:
	addl	$1, -44(%rbp)
.L49:
	movl	-52(%rbp), %eax
	cmpl	%eax, -44(%rbp)
	jl	.L55
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L57
	call	__stack_chk_fail@PLT
.L57:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.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	treeMinimum
	.type	treeMinimum, @function
treeMinimum:
.LFB39:
	.cfi_startproc
	endbr64
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rdi, %rax
	movq	8(%rdi), %rdi
	testq	%rdi, %rdi
	jne	.L2
	ret
	.cfi_endproc
.LFE39:
	.size	treeMinimum, .-treeMinimum
	.p2align 4
	.globl	treeMaximum
	.type	treeMaximum, @function
treeMaximum:
.LFB40:
	.cfi_startproc
	endbr64
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rdi, %rax
	movq	(%rdi), %rdi
	testq	%rdi, %rdi
	jne	.L6
	ret
	.cfi_endproc
.LFE40:
	.size	treeMaximum, .-treeMaximum
	.p2align 4
	.globl	treeSearch
	.type	treeSearch, @function
treeSearch:
.LFB41:
	.cfi_startproc
	endbr64
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L18:
	cmpl	%esi, 24(%rdi)
	je	.L17
	movq	(%rdi), %rax
	cmovg	8(%rdi), %rax
	movq	%rax, %rdi
.L16:
	testq	%rdi, %rdi
	jne	.L18
	xorl	%eax, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L17:
	movq	%rdi, %rax
	ret
	.cfi_endproc
.LFE41:
	.size	treeSearch, .-treeSearch
	.p2align 4
	.globl	treeSuccessor
	.type	treeSuccessor, @function
treeSuccessor:
.LFB42:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rdx
	testq	%rdx, %rdx
	je	.L20
	.p2align 4,,10
	.p2align 3
.L21:
	movq	%rdx, %rax
	movq	8(%rdx), %rdx
	testq	%rdx, %rdx
	jne	.L21
	ret
	.p2align 4,,10
	.p2align 3
.L20:
	movq	16(%rdi), %rax
	testq	%rax, %rax
	jne	.L23
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L24:
	movq	16(%rax), %rdx
	movq	%rax, %rdi
	testq	%rdx, %rdx
	je	.L25
	movq	%rdx, %rax
.L23:
	cmpq	(%rax), %rdi
	je	.L24
	ret
	.p2align 4,,10
	.p2align 3
.L25:
	xorl	%eax, %eax
	ret
.L28:
	ret
	.cfi_endproc
.LFE42:
	.size	treeSuccessor, .-treeSuccessor
	.p2align 4
	.globl	treeDelete
	.type	treeDelete, @function
treeDelete:
.LFB43:
	.cfi_startproc
	endbr64
	movq	8(%rdi), %rcx
	movq	(%rdi), %rax
	movq	%rdi, %rdx
	testq	%rcx, %rcx
	je	.L30
	testq	%rax, %rax
	je	.L31
	.p2align 4,,10
	.p2align 3
.L32:
	movq	%rax, %rdi
	movq	8(%rax), %rax
	testq	%rax, %rax
	jne	.L32
.L30:
	movq	(%rdi), %rcx
	testq	%rcx, %rcx
	je	.L37
	.p2align 4,,10
	.p2align 3
.L31:
	movq	16(%rdi), %rax
	movq	%rax, 16(%rcx)
.L37:
	movq	16(%rdi), %rax
	testq	%rax, %rax
	je	.L41
	cmpq	%rdi, 8(%rax)
	je	.L42
	movq	%rcx, (%rax)
.L34:
	cmpq	%rdi, %rdx
	je	.L36
	movl	24(%rdi), %eax
	movl	%eax, 24(%rdx)
.L36:
	jmp	free@PLT
	.p2align 4,,10
	.p2align 3
.L42:
	movq	%rcx, 8(%rax)
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L41:
	movq	%rcx, root(%rip)
	jmp	.L34
	.cfi_endproc
.LFE43:
	.size	treeDelete, .-treeDelete
	.p2align 4
	.globl	insert
	.type	insert, @function
insert:
.LFB44:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	%edi, %ebp
	movl	$32, %edi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	movq	root(%rip), %rbx
	call	malloc@PLT
	pxor	%xmm0, %xmm0
	movl	%ebp, 24(%rax)
	movups	%xmm0, (%rax)
	testq	%rbx, %rbx
	je	.L44
	.p2align 4,,10
	.p2align 3
.L49:
	movq	(%rbx), %rcx
	movq	8(%rbx), %rdx
	cmpl	24(%rbx), %ebp
	jge	.L45
.L55:
	testq	%rdx, %rdx
	je	.L54
	movq	%rdx, %rbx
	movq	(%rbx), %rcx
	movq	8(%rbx), %rdx
	cmpl	24(%rbx), %ebp
	jl	.L55
.L45:
	testq	%rcx, %rcx
	je	.L48
	movq	%rcx, %rbx
	jmp	.L49
	.p2align 4,,10
	.p2align 3
.L54:
	movq	%rbx, 16(%rax)
	movq	%rax, 8(%rbx)
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L48:
	.cfi_restore_state
	movq	%rbx, 16(%rax)
	movq	%rax, (%rbx)
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L44:
	.cfi_restore_state
	movq	$0, 16(%rax)
	movq	%rax, root(%rip)
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE44:
	.size	insert, .-insert
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	" %d"
	.text
	.p2align 4
	.globl	inorder
	.type	inorder, @function
inorder:
.LFB45:
	.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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%rdi, 16(%rsp)
	testq	%rdi, %rdi
	je	.L56
	leaq	.LC0(%rip), %rbx
.L57:
	movq	16(%rsp), %rax
	movq	8(%rax), %rax
	movq	%rax, (%rsp)
	testq	%rax, %rax
	je	.L58
.L73:
	movq	(%rsp), %rax
	movq	8(%rax), %rax
	movq	%rax, 8(%rsp)
	testq	%rax, %rax
	je	.L59
.L72:
	movq	8(%rsp), %rax
	movq	8(%rax), %r15
	testq	%r15, %r15
	je	.L60
.L71:
	movq	8(%r15), %rbp
	testq	%rbp, %rbp
	je	.L61
.L70:
	movq	8(%rbp), %r13
	testq	%r13, %r13
	je	.L62
.L69:
	movq	8(%r13), %r12
	testq	%r12, %r12
	je	.L63
.L68:
	movq	8(%r12), %r14
	testq	%r14, %r14
	je	.L64
.L67:
	movq	8(%r14), %r10
	testq	%r10, %r10
	je	.L65
.L66:
	movq	8(%r10), %rdi
	movq	%r10, 24(%rsp)
	call	inorder
	movq	24(%rsp), %r10
	movq	%rbx, %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	movl	24(%r10), %edx
	call	__printf_chk@PLT
	movq	24(%rsp), %r10
	movq	(%r10), %r10
	testq	%r10, %r10
	jne	.L66
.L65:
	movl	24(%r14), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	(%r14), %r14
	testq	%r14, %r14
	jne	.L67
.L64:
	movl	24(%r12), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	(%r12), %r12
	testq	%r12, %r12
	jne	.L68
.L63:
	movl	24(%r13), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	0(%r13), %r13
	testq	%r13, %r13
	jne	.L69
.L62:
	movl	24(%rbp), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	0(%rbp), %rbp
	testq	%rbp, %rbp
	jne	.L70
.L61:
	movl	24(%r15), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	(%r15), %r15
	testq	%r15, %r15
	jne	.L71
.L60:
	movq	8(%rsp), %r15
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	24(%r15), %edx
	call	__printf_chk@PLT
	movq	(%r15), %rax
	movq	%rax, 8(%rsp)
	testq	%rax, %rax
	jne	.L72
.L59:
	movq	(%rsp), %r15
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	24(%r15), %edx
	call	__printf_chk@PLT
	movq	(%r15), %rax
	movq	%rax, (%rsp)
	testq	%rax, %rax
	jne	.L73
.L58:
	movq	16(%rsp), %r14
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	24(%r14), %edx
	call	__printf_chk@PLT
	movq	(%r14), %rax
	movq	%rax, 16(%rsp)
	testq	%rax, %rax
	jne	.L57
.L56:
	addq	$40, %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
.LFE45:
	.size	inorder, .-inorder
	.p2align 4
	.globl	preorder
	.type	preorder, @function
preorder:
.LFB46:
	.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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%rdi, 16(%rsp)
	testq	%rdi, %rdi
	je	.L113
	leaq	.LC0(%rip), %rbx
.L114:
	movq	16(%rsp), %r15
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	24(%r15), %edx
	call	__printf_chk@PLT
	movq	8(%r15), %rax
	movq	%rax, (%rsp)
	testq	%rax, %rax
	je	.L115
.L130:
	movq	(%rsp), %r15
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	24(%r15), %edx
	call	__printf_chk@PLT
	movq	8(%r15), %rax
	movq	%rax, 8(%rsp)
	testq	%rax, %rax
	je	.L116
.L129:
	movq	8(%rsp), %r14
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	24(%r14), %edx
	call	__printf_chk@PLT
	movq	8(%r14), %r15
	testq	%r15, %r15
	je	.L117
.L128:
	movl	24(%r15), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%r15), %rbp
	testq	%rbp, %rbp
	je	.L118
.L127:
	movl	24(%rbp), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%rbp), %r13
	testq	%r13, %r13
	je	.L119
.L126:
	movl	24(%r13), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%r13), %r12
	testq	%r12, %r12
	je	.L120
.L125:
	movl	24(%r12), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%r12), %r14
	testq	%r14, %r14
	je	.L121
.L124:
	movl	24(%r14), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%r14), %r10
	testq	%r10, %r10
	je	.L122
.L123:
	movl	24(%r10), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movq	%r10, 24(%rsp)
	call	__printf_chk@PLT
	movq	24(%rsp), %r10
	movq	8(%r10), %rdi
	call	preorder
	movq	24(%rsp), %r10
	movq	(%r10), %r10
	testq	%r10, %r10
	jne	.L123
.L122:
	movq	(%r14), %r14
	testq	%r14, %r14
	jne	.L124
.L121:
	movq	(%r12), %r12
	testq	%r12, %r12
	jne	.L125
.L120:
	movq	0(%r13), %r13
	testq	%r13, %r13
	jne	.L126
.L119:
	movq	0(%rbp), %rbp
	testq	%rbp, %rbp
	jne	.L127
.L118:
	movq	(%r15), %r15
	testq	%r15, %r15
	jne	.L128
.L117:
	movq	8(%rsp), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%rsp)
	testq	%rax, %rax
	jne	.L129
.L116:
	movq	(%rsp), %rax
	movq	(%rax), %rax
	movq	%rax, (%rsp)
	testq	%rax, %rax
	jne	.L130
.L115:
	movq	16(%rsp), %rax
	movq	(%rax), %rax
	movq	%rax, 16(%rsp)
	testq	%rax, %rax
	jne	.L114
.L113:
	addq	$40, %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
.LFE46:
	.size	preorder, .-preorder
	.section	.rodata.str1.1
.LC1:
	.string	"%d"
.LC2:
	.string	"%s"
.LC3:
	.string	"yes"
.LC4:
	.string	"no"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB47:
	.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
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L171
	xorl	%ebx, %ebx
	leaq	16(%rsp), %r12
	leaq	.LC2(%rip), %rbp
	leaq	12(%rsp), %r14
	leaq	.LC3(%rip), %r15
	jmp	.L185
	.p2align 4,,10
	.p2align 3
.L178:
	cmpb	$112, %al
	je	.L199
	cmpb	$100, %al
	je	.L200
.L179:
	addl	$1, %ebx
	cmpl	%ebx, 8(%rsp)
	jle	.L171
.L185:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movzbl	16(%rsp), %eax
	cmpb	$102, %al
	je	.L201
	cmpb	$105, %al
	jne	.L178
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edi
	call	insert
	cmpl	%ebx, 8(%rsp)
	jg	.L185
	.p2align 4,,10
	.p2align 3
.L171:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L202
	addq	$56, %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
.L199:
	.cfi_restore_state
	movq	root(%rip), %rdi
	call	inorder
	movl	$10, %edi
	call	putchar@PLT
	movq	root(%rip), %rdi
	call	preorder
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L179
	.p2align 4,,10
	.p2align 3
.L201:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	root(%rip), %rax
	movl	12(%rsp), %ecx
	testq	%rax, %rax
	jne	.L173
	jmp	.L174
	.p2align 4,,10
	.p2align 3
.L176:
	movq	(%rax), %rdx
	cmovl	8(%rax), %rdx
	movq	%rdx, %rax
	testq	%rdx, %rdx
	je	.L174
.L173:
	cmpl	24(%rax), %ecx
	jne	.L176
	movq	%r15, %rdi
	call	puts@PLT
	jmp	.L179
.L200:
	movq	%r13, %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	root(%rip), %rdi
	movl	12(%rsp), %edx
	testq	%rdi, %rdi
	jne	.L181
	jmp	.L182
	.p2align 4,,10
	.p2align 3
.L184:
	movq	(%rdi), %rax
	cmovl	8(%rdi), %rax
	movq	%rax, %rdi
	testq	%rax, %rax
	je	.L182
.L181:
	cmpl	24(%rdi), %edx
	jne	.L184
.L182:
	call	treeDelete
	jmp	.L179
.L174:
	leaq	.LC4(%rip), %rdi
	call	puts@PLT
	jmp	.L179
.L202:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE47:
	.size	main, .-main
	.globl	root
	.bss
	.align 8
	.type	root, @object
	.size	root, 8
root:
	.zero	8
	.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	treeMinimum
	.type	treeMinimum, @function
treeMinimum:
.LFB39:
	.cfi_startproc
	endbr64
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rdi, %rax
	movq	8(%rdi), %rdi
	testq	%rdi, %rdi
	jne	.L2
	ret
	.cfi_endproc
.LFE39:
	.size	treeMinimum, .-treeMinimum
	.p2align 4
	.globl	treeMaximum
	.type	treeMaximum, @function
treeMaximum:
.LFB40:
	.cfi_startproc
	endbr64
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rdi, %rax
	movq	(%rdi), %rdi
	testq	%rdi, %rdi
	jne	.L6
	ret
	.cfi_endproc
.LFE40:
	.size	treeMaximum, .-treeMaximum
	.p2align 4
	.globl	treeSearch
	.type	treeSearch, @function
treeSearch:
.LFB41:
	.cfi_startproc
	endbr64
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L18:
	cmpl	%esi, 24(%rdi)
	je	.L17
	movq	(%rdi), %rax
	cmovg	8(%rdi), %rax
	movq	%rax, %rdi
.L16:
	testq	%rdi, %rdi
	jne	.L18
	xorl	%eax, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L17:
	movq	%rdi, %rax
	ret
	.cfi_endproc
.LFE41:
	.size	treeSearch, .-treeSearch
	.p2align 4
	.globl	treeSuccessor
	.type	treeSuccessor, @function
treeSuccessor:
.LFB42:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rdx
	testq	%rdx, %rdx
	je	.L20
	.p2align 4,,10
	.p2align 3
.L21:
	movq	%rdx, %rax
	movq	8(%rdx), %rdx
	testq	%rdx, %rdx
	jne	.L21
	ret
	.p2align 4,,10
	.p2align 3
.L20:
	movq	16(%rdi), %rax
	testq	%rax, %rax
	jne	.L23
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L24:
	movq	16(%rax), %rdx
	movq	%rax, %rdi
	testq	%rdx, %rdx
	je	.L25
	movq	%rdx, %rax
.L23:
	cmpq	(%rax), %rdi
	je	.L24
	ret
	.p2align 4,,10
	.p2align 3
.L25:
	xorl	%eax, %eax
	ret
.L28:
	ret
	.cfi_endproc
.LFE42:
	.size	treeSuccessor, .-treeSuccessor
	.p2align 4
	.globl	treeDelete
	.type	treeDelete, @function
treeDelete:
.LFB43:
	.cfi_startproc
	endbr64
	movq	8(%rdi), %rcx
	movq	(%rdi), %rax
	movq	%rdi, %rdx
	testq	%rcx, %rcx
	je	.L30
	testq	%rax, %rax
	je	.L31
	.p2align 4,,10
	.p2align 3
.L32:
	movq	%rax, %rdi
	movq	8(%rax), %rax
	testq	%rax, %rax
	jne	.L32
.L30:
	movq	(%rdi), %rcx
	testq	%rcx, %rcx
	je	.L37
	.p2align 4,,10
	.p2align 3
.L31:
	movq	16(%rdi), %rax
	movq	%rax, 16(%rcx)
.L37:
	movq	16(%rdi), %rax
	testq	%rax, %rax
	je	.L41
	cmpq	%rdi, 8(%rax)
	je	.L42
	movq	%rcx, (%rax)
.L34:
	cmpq	%rdi, %rdx
	je	.L36
	movl	24(%rdi), %eax
	movl	%eax, 24(%rdx)
.L36:
	jmp	free@PLT
	.p2align 4,,10
	.p2align 3
.L42:
	movq	%rcx, 8(%rax)
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L41:
	movq	%rcx, root(%rip)
	jmp	.L34
	.cfi_endproc
.LFE43:
	.size	treeDelete, .-treeDelete
	.p2align 4
	.globl	insert
	.type	insert, @function
insert:
.LFB44:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	%edi, %ebp
	movl	$32, %edi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	movq	root(%rip), %rbx
	call	malloc@PLT
	pxor	%xmm0, %xmm0
	movl	%ebp, 24(%rax)
	movups	%xmm0, (%rax)
	testq	%rbx, %rbx
	je	.L44
	.p2align 4,,10
	.p2align 3
.L49:
	movq	(%rbx), %rcx
	movq	8(%rbx), %rdx
	cmpl	24(%rbx), %ebp
	jge	.L45
.L55:
	testq	%rdx, %rdx
	je	.L54
	movq	%rdx, %rbx
	movq	(%rbx), %rcx
	movq	8(%rbx), %rdx
	cmpl	24(%rbx), %ebp
	jl	.L55
.L45:
	testq	%rcx, %rcx
	je	.L48
	movq	%rcx, %rbx
	jmp	.L49
	.p2align 4,,10
	.p2align 3
.L54:
	movq	%rbx, 16(%rax)
	movq	%rax, 8(%rbx)
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L48:
	.cfi_restore_state
	movq	%rbx, 16(%rax)
	movq	%rax, (%rbx)
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L44:
	.cfi_restore_state
	movq	$0, 16(%rax)
	movq	%rax, root(%rip)
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE44:
	.size	insert, .-insert
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	" %d"
	.text
	.p2align 4
	.globl	inorder
	.type	inorder, @function
inorder:
.LFB45:
	.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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%rdi, 16(%rsp)
	testq	%rdi, %rdi
	je	.L56
	leaq	.LC0(%rip), %rbx
.L57:
	movq	16(%rsp), %rax
	movq	8(%rax), %rax
	movq	%rax, (%rsp)
	testq	%rax, %rax
	je	.L58
.L73:
	movq	(%rsp), %rax
	movq	8(%rax), %rax
	movq	%rax, 8(%rsp)
	testq	%rax, %rax
	je	.L59
.L72:
	movq	8(%rsp), %rax
	movq	8(%rax), %r15
	testq	%r15, %r15
	je	.L60
.L71:
	movq	8(%r15), %rbp
	testq	%rbp, %rbp
	je	.L61
.L70:
	movq	8(%rbp), %r13
	testq	%r13, %r13
	je	.L62
.L69:
	movq	8(%r13), %r12
	testq	%r12, %r12
	je	.L63
.L68:
	movq	8(%r12), %r14
	testq	%r14, %r14
	je	.L64
.L67:
	movq	8(%r14), %r10
	testq	%r10, %r10
	je	.L65
.L66:
	movq	8(%r10), %rdi
	movq	%r10, 24(%rsp)
	call	inorder
	movq	24(%rsp), %r10
	movq	%rbx, %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	movl	24(%r10), %edx
	call	__printf_chk@PLT
	movq	24(%rsp), %r10
	movq	(%r10), %r10
	testq	%r10, %r10
	jne	.L66
.L65:
	movl	24(%r14), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	(%r14), %r14
	testq	%r14, %r14
	jne	.L67
.L64:
	movl	24(%r12), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	(%r12), %r12
	testq	%r12, %r12
	jne	.L68
.L63:
	movl	24(%r13), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	0(%r13), %r13
	testq	%r13, %r13
	jne	.L69
.L62:
	movl	24(%rbp), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	0(%rbp), %rbp
	testq	%rbp, %rbp
	jne	.L70
.L61:
	movl	24(%r15), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	(%r15), %r15
	testq	%r15, %r15
	jne	.L71
.L60:
	movq	8(%rsp), %r15
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	24(%r15), %edx
	call	__printf_chk@PLT
	movq	(%r15), %rax
	movq	%rax, 8(%rsp)
	testq	%rax, %rax
	jne	.L72
.L59:
	movq	(%rsp), %r15
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	24(%r15), %edx
	call	__printf_chk@PLT
	movq	(%r15), %rax
	movq	%rax, (%rsp)
	testq	%rax, %rax
	jne	.L73
.L58:
	movq	16(%rsp), %r14
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	24(%r14), %edx
	call	__printf_chk@PLT
	movq	(%r14), %rax
	movq	%rax, 16(%rsp)
	testq	%rax, %rax
	jne	.L57
.L56:
	addq	$40, %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
.LFE45:
	.size	inorder, .-inorder
	.p2align 4
	.globl	preorder
	.type	preorder, @function
preorder:
.LFB46:
	.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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%rdi, 16(%rsp)
	testq	%rdi, %rdi
	je	.L113
	leaq	.LC0(%rip), %rbx
.L114:
	movq	16(%rsp), %r15
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	24(%r15), %edx
	call	__printf_chk@PLT
	movq	8(%r15), %rax
	movq	%rax, (%rsp)
	testq	%rax, %rax
	je	.L115
.L130:
	movq	(%rsp), %r15
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	24(%r15), %edx
	call	__printf_chk@PLT
	movq	8(%r15), %rax
	movq	%rax, 8(%rsp)
	testq	%rax, %rax
	je	.L116
.L129:
	movq	8(%rsp), %r14
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	24(%r14), %edx
	call	__printf_chk@PLT
	movq	8(%r14), %r15
	testq	%r15, %r15
	je	.L117
.L128:
	movl	24(%r15), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%r15), %rbp
	testq	%rbp, %rbp
	je	.L118
.L127:
	movl	24(%rbp), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%rbp), %r13
	testq	%r13, %r13
	je	.L119
.L126:
	movl	24(%r13), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%r13), %r12
	testq	%r12, %r12
	je	.L120
.L125:
	movl	24(%r12), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%r12), %r14
	testq	%r14, %r14
	je	.L121
.L124:
	movl	24(%r14), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%r14), %r10
	testq	%r10, %r10
	je	.L122
.L123:
	movl	24(%r10), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movq	%r10, 24(%rsp)
	call	__printf_chk@PLT
	movq	24(%rsp), %r10
	movq	8(%r10), %rdi
	call	preorder
	movq	24(%rsp), %r10
	movq	(%r10), %r10
	testq	%r10, %r10
	jne	.L123
.L122:
	movq	(%r14), %r14
	testq	%r14, %r14
	jne	.L124
.L121:
	movq	(%r12), %r12
	testq	%r12, %r12
	jne	.L125
.L120:
	movq	0(%r13), %r13
	testq	%r13, %r13
	jne	.L126
.L119:
	movq	0(%rbp), %rbp
	testq	%rbp, %rbp
	jne	.L127
.L118:
	movq	(%r15), %r15
	testq	%r15, %r15
	jne	.L128
.L117:
	movq	8(%rsp), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%rsp)
	testq	%rax, %rax
	jne	.L129
.L116:
	movq	(%rsp), %rax
	movq	(%rax), %rax
	movq	%rax, (%rsp)
	testq	%rax, %rax
	jne	.L130
.L115:
	movq	16(%rsp), %rax
	movq	(%rax), %rax
	movq	%rax, 16(%rsp)
	testq	%rax, %rax
	jne	.L114
.L113:
	addq	$40, %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
.LFE46:
	.size	preorder, .-preorder
	.section	.rodata.str1.1
.LC1:
	.string	"%d"
.LC2:
	.string	"%s"
.LC3:
	.string	"yes"
.LC4:
	.string	"no"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB47:
	.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
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L171
	xorl	%ebx, %ebx
	leaq	16(%rsp), %r12
	leaq	.LC2(%rip), %rbp
	leaq	12(%rsp), %r14
	leaq	.LC3(%rip), %r15
	jmp	.L185
	.p2align 4,,10
	.p2align 3
.L178:
	cmpb	$112, %al
	je	.L199
	cmpb	$100, %al
	je	.L200
.L179:
	addl	$1, %ebx
	cmpl	%ebx, 8(%rsp)
	jle	.L171
.L185:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movzbl	16(%rsp), %eax
	cmpb	$102, %al
	je	.L201
	cmpb	$105, %al
	jne	.L178
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edi
	call	insert
	cmpl	%ebx, 8(%rsp)
	jg	.L185
	.p2align 4,,10
	.p2align 3
.L171:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L202
	addq	$56, %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
.L199:
	.cfi_restore_state
	movq	root(%rip), %rdi
	call	inorder
	movl	$10, %edi
	call	putchar@PLT
	movq	root(%rip), %rdi
	call	preorder
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L179
	.p2align 4,,10
	.p2align 3
.L201:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	root(%rip), %rax
	movl	12(%rsp), %ecx
	testq	%rax, %rax
	jne	.L173
	jmp	.L174
	.p2align 4,,10
	.p2align 3
.L176:
	movq	(%rax), %rdx
	cmovl	8(%rax), %rdx
	movq	%rdx, %rax
	testq	%rdx, %rdx
	je	.L174
.L173:
	cmpl	24(%rax), %ecx
	jne	.L176
	movq	%r15, %rdi
	call	puts@PLT
	jmp	.L179
.L200:
	movq	%r13, %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	root(%rip), %rdi
	movl	12(%rsp), %edx
	testq	%rdi, %rdi
	jne	.L181
	jmp	.L182
	.p2align 4,,10
	.p2align 3
.L184:
	movq	(%rdi), %rax
	cmovl	8(%rdi), %rax
	movq	%rax, %rdi
	testq	%rax, %rax
	je	.L182
.L181:
	cmpl	24(%rdi), %edx
	jne	.L184
.L182:
	call	treeDelete
	jmp	.L179
.L174:
	leaq	.LC4(%rip), %rdi
	call	puts@PLT
	jmp	.L179
.L202:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE47:
	.size	main, .-main
	.globl	root
	.bss
	.align 8
	.type	root, @object
	.size	root, 8
root:
	.zero	8
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

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


struct node{
  struct node *right;
  struct node *left;
  struct node *parent;
  int key;
};
typedef struct node * Node;
#define NIL NULL

Node root;

Node treeMinimum(Node x){
  while(x->left!=NIL)
    x=x->left;
  return x;

}
Node treeMaximum(Node x){
  while(x->right!=NIL)
    x=x->right;
  return x;

}


Node treeSearch(Node u, int k){
  while(u!=NIL&&k!=u->key){
    if(k<u->key)u=u->left;
    else u=u->right;
  }
  return u;
}

Node treeSuccessor(Node x){
  Node y;
  if(x->right!=NIL)return treeMinimum(x->right);
  y=x->parent;
   while(y!=NIL&&x==y->right){
    x=y;
    y=y->parent;
  }
  return y;
}

void treeDelete(Node z){
  Node y; // node to be deleted
  Node x; // child of y
  if(z->left==NIL||z->right==NIL)y=z;
  else y=treeSuccessor(z);

  if(y->left!=NIL){
    x=y->left;
  }else{
    x=y->right;
  }

  if(x!=NIL){
    x->parent=y->parent;
  }

  if(y->parent==NIL){
    root=x;
  }else{
    if(y==y->parent->left){
      y->parent->left=x;
    }else{
      y->parent->right=x;
    }
  }

  if(y!=z){
    z->key=y->key;
  }
  free(y);
}

void insert(int k){
  Node y = NIL;
  Node x = root;
  Node z;

  z = malloc(sizeof(struct node));
  z->key = k;
  z->left = NIL;
  z->right = NIL;

  while(x!=NIL){
    y=x;
    if(z->key < x->key){
      x=x->left;
    }else{
      x=x->right;
    }
  }
  z->parent = y;
  if(y==NIL){
    root=z;
  }else{
    if(z->key < y->key){
      y->left=z;
    }else{
      y->right=z;
    }
  }
}

void inorder(Node u){
  if(u==NIL)return;
  inorder(u->left);
  printf(" %d",u->key);
  inorder(u->right);
}
void preorder(Node u){
  if(u==NIL)return;
  printf(" %d",u->key);
  preorder(u->left);
  preorder(u->right);
}


int main(){
  int n, i, x;
  char com[20];
  scanf("%d", &n);

  for ( i = 0; i < n; i++ ){
    scanf("%s", com);
    if ( com[0] == 'f' ){
      scanf("%d", &x);
      Node t = treeSearch(root, x);
      if ( t != NIL ) printf("yes\n");
      else printf("no\n");
    } else if ( com[0] == 'i' ){
      scanf("%d", &x);
      insert(x);
    } else if ( com[0] == 'p' ){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    } else if ( com[0] == 'd' ){
      scanf("%d", &x);
      treeDelete(treeSearch(root, x));
    }
  }

  return 0;
}


10
insert 30
insert 88
insert 12
insert 1
insert 29
find 12
insert 17
insert 25
find 16
print
 10
insert 30
insert 88
insert 12
insert 2
insert 20
find 12
insert 17
insert 25
find 16
print
 10
insert 30
insert 88
insert 12
insert 1
insert 29
find 15
insert 17
insert 25
find 16
print
 10
insert 30
insert 88
insert 12
insert 1
insert 20
find 13
insert 17
insert 25
find 16
print
 10
insert 30
insert 88
insert 19
insert 1
insert 20
find 13
insert 17
insert 25
find 16
print
 10
insert 30
insert 88
insert 12
insert 0
insert 29
find 12
insert 17
insert 25
find 16
print
 10
insert 30
insert 88
insert 12
insert 2
insert 20
find 12
insert 1
insert 25
find 16
print
 10
insert 30
insert 88
insert 19
insert 1
insert 20
find 13
insert 17
insert 25
find 25
print
 10
insert 30
insert 88
insert 7
insert 0
insert 29
find 12
insert 17
insert 25
find 16
print
 10
insert 35
insert 88
insert 12
insert 2
insert 20
find 12
insert 17
insert 25
find 16
print

yes
no
 1 12 17 25 29 30 88
 30 12 1 29 17 25 88
 yes
no
 2 12 17 20 25 30 88
 30 12 2 20 17 25 88
 no
no
 1 12 17 25 29 30 88
 30 12 1 29 17 25 88
 no
no
 1 12 17 20 25 30 88
 30 12 1 20 17 25 88
 no
no
 1 17 19 20 25 30 88
 30 19 1 17 20 25 88
 yes
no
 0 12 17 25 29 30 88
 30 12 0 29 17 25 88
 yes
no
 1 2 12 20 25 30 88
 30 12 2 1 20 25 88
 no
yes
 1 17 19 20 25 30 88
 30 19 1 17 20 25 88
 no
no
 0 7 17 25 29 30 88
 30 7 0 29 17 25 88
 yes
no
 2 12 17 20 25 35 88
 35 12 2 20 17 25 88

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

```c
#include<stdio.h>
#include<stdlib.h>


struct node{
  struct node *right;
  struct node *left;
  struct node *parent;
  int key;
};
typedef struct node * Node;
#define NIL NULL

Node root;

Node treeMinimum(Node x){
  while(x->left!=NIL)
    x=x->left;
  return x;

}
Node treeMaximum(Node x){
  while(x->right!=NIL)
    x=x->right;
  return x;

}


Node treeSearch(Node u, int k){
  while(u!=NIL&&k!=u->key){
    if(k<u->key)u=u->left;
    else u=u->right;
  }
  return u;
}

Node treeSuccessor(Node x){
  Node y;
  if(x->right!=NIL)return treeMinimum(x->right);
  y=x->parent;
   while(y!=NIL&&x==y->right){
    x=y;
    y=y->parent;
  }
  return y;
}

void treeDelete(Node z){
  Node y; // node to be deleted
  Node x; // child of y
  if(z->left==NIL||z->right==NIL)y=z;
  else y=treeSuccessor(z);

  if(y->left!=NIL){
    x=y->left;
  }else{
    x=y->right;
  }

  if(x!=NIL){
    x->parent=y->parent;
  }

  if(y->parent==NIL){
    root=x;
  }else{
    if(y==y->parent->left){
      y->parent->left=x;
    }else{
      y->parent->right=x;
    }
  }

  if(y!=z){
    z->key=y->key;
  }
  free(y);
}

void insert(int k){
  Node y = NIL;
  Node x = root;
  Node z;

  z = malloc(sizeof(struct node));
  z->key = k;
  z->left = NIL;
  z->right = NIL;

  while(x!=NIL){
    y=x;
    if(z->key < x->key){
      x=x->left;
    }else{
      x=x->right;
    }
  }
  z->parent = y;
  if(y==NIL){
    root=z;
  }else{
    if(z->key < y->key){
      y->left=z;
    }else{
      y->right=z;
    }
  }
}

void inorder(Node u){
  if(u==NIL)return;
  inorder(u->left);
  printf(" %d",u->key);
  inorder(u->right);
}
void preorder(Node u){
  if(u==NIL)return;
  printf(" %d",u->key);
  preorder(u->left);
  preorder(u->right);
}


int main(){
  int n, i, x;
  char com[20];
  scanf("%d", &n);

  for ( i = 0; i < n; i++ ){
    scanf("%s", com);
    if ( com[0] == 'f' ){
      scanf("%d", &x);
      Node t = treeSearch(root, x);
      if ( t != NIL ) printf("yes\n");
      else printf("no\n");
    } else if ( com[0] == 'i' ){
      scanf("%d", &x);
      insert(x);
    } else if ( com[0] == 'p' ){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    } else if ( com[0] == 'd' ){
      scanf("%d", &x);
      treeDelete(treeSearch(root, x));
    }
  }

  return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	root
	.bss
	.align 8
	.type	root, @object
	.size	root, 8
root:
	.zero	8
	.text
	.globl	treeMinimum
	.type	treeMinimum, @function
treeMinimum:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	jmp	.L2
.L3:
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -8(%rbp)
.L2:
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	testq	%rax, %rax
	jne	.L3
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	treeMinimum, .-treeMinimum
	.globl	treeMaximum
	.type	treeMaximum, @function
treeMaximum:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	jmp	.L6
.L7:
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
.L6:
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	jne	.L7
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	treeMaximum, .-treeMaximum
	.globl	treeSearch
	.type	treeSearch, @function
treeSearch:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	jmp	.L10
.L13:
	movq	-8(%rbp), %rax
	movl	24(%rax), %eax
	cmpl	%eax, -12(%rbp)
	jge	.L11
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -8(%rbp)
	jmp	.L10
.L11:
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
.L10:
	cmpq	$0, -8(%rbp)
	je	.L12
	movq	-8(%rbp), %rax
	movl	24(%rax), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L13
.L12:
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	treeSearch, .-treeSearch
	.globl	treeSuccessor
	.type	treeSuccessor, @function
treeSuccessor:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$24, %rsp
	movq	%rdi, -24(%rbp)
	movq	-24(%rbp), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	.L16
	movq	-24(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, %rdi
	call	treeMinimum
	jmp	.L17
.L16:
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, -8(%rbp)
	jmp	.L18
.L20:
	movq	-8(%rbp), %rax
	movq	%rax, -24(%rbp)
	movq	-8(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, -8(%rbp)
.L18:
	cmpq	$0, -8(%rbp)
	je	.L19
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, -24(%rbp)
	je	.L20
.L19:
	movq	-8(%rbp), %rax
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	treeSuccessor, .-treeSuccessor
	.globl	treeDelete
	.type	treeDelete, @function
treeDelete:
.LFB10:
	.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	%rdi, -24(%rbp)
	movq	-24(%rbp), %rax
	movq	8(%rax), %rax
	testq	%rax, %rax
	je	.L22
	movq	-24(%rbp), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	jne	.L23
.L22:
	movq	-24(%rbp), %rax
	movq	%rax, -16(%rbp)
	jmp	.L24
.L23:
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	treeSuccessor
	movq	%rax, -16(%rbp)
.L24:
	movq	-16(%rbp), %rax
	movq	8(%rax), %rax
	testq	%rax, %rax
	je	.L25
	movq	-16(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -8(%rbp)
	jmp	.L26
.L25:
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
.L26:
	cmpq	$0, -8(%rbp)
	je	.L27
	movq	-16(%rbp), %rax
	movq	16(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 16(%rax)
.L27:
	movq	-16(%rbp), %rax
	movq	16(%rax), %rax
	testq	%rax, %rax
	jne	.L28
	movq	-8(%rbp), %rax
	movq	%rax, root(%rip)
	jmp	.L29
.L28:
	movq	-16(%rbp), %rax
	movq	16(%rax), %rax
	movq	8(%rax), %rax
	cmpq	%rax, -16(%rbp)
	jne	.L30
	movq	-16(%rbp), %rax
	movq	16(%rax), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, 8(%rax)
	jmp	.L29
.L30:
	movq	-16(%rbp), %rax
	movq	16(%rax), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, (%rax)
.L29:
	movq	-16(%rbp), %rax
	cmpq	-24(%rbp), %rax
	je	.L31
	movq	-16(%rbp), %rax
	movl	24(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, 24(%rax)
.L31:
	movq	-16(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	treeDelete, .-treeDelete
	.globl	insert
	.type	insert, @function
insert:
.LFB11:
	.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
	movl	%edi, -36(%rbp)
	movq	$0, -24(%rbp)
	movq	root(%rip), %rax
	movq	%rax, -16(%rbp)
	movl	$32, %edi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movl	-36(%rbp), %edx
	movl	%edx, 24(%rax)
	movq	-8(%rbp), %rax
	movq	$0, 8(%rax)
	movq	-8(%rbp), %rax
	movq	$0, (%rax)
	jmp	.L33
.L35:
	movq	-16(%rbp), %rax
	movq	%rax, -24(%rbp)
	movq	-8(%rbp), %rax
	movl	24(%rax), %edx
	movq	-16(%rbp), %rax
	movl	24(%rax), %eax
	cmpl	%eax, %edx
	jge	.L34
	movq	-16(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -16(%rbp)
	jmp	.L33
.L34:
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
.L33:
	cmpq	$0, -16(%rbp)
	jne	.L35
	movq	-8(%rbp), %rax
	movq	-24(%rbp), %rdx
	movq	%rdx, 16(%rax)
	cmpq	$0, -24(%rbp)
	jne	.L36
	movq	-8(%rbp), %rax
	movq	%rax, root(%rip)
	jmp	.L39
.L36:
	movq	-8(%rbp), %rax
	movl	24(%rax), %edx
	movq	-24(%rbp), %rax
	movl	24(%rax), %eax
	cmpl	%eax, %edx
	jge	.L38
	movq	-24(%rbp), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, 8(%rax)
	jmp	.L39
.L38:
	movq	-24(%rbp), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, (%rax)
.L39:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	insert, .-insert
	.section	.rodata
.LC0:
	.string	" %d"
	.text
	.globl	inorder
	.type	inorder, @function
inorder:
.LFB12:
	.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
	movq	%rdi, -8(%rbp)
	cmpq	$0, -8(%rbp)
	je	.L43
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, %rdi
	call	inorder
	movq	-8(%rbp), %rax
	movl	24(%rax), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, %rdi
	call	inorder
	jmp	.L40
.L43:
	nop
.L40:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	inorder, .-inorder
	.globl	preorder
	.type	preorder, @function
preorder:
.LFB13:
	.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
	movq	%rdi, -8(%rbp)
	cmpq	$0, -8(%rbp)
	je	.L47
	movq	-8(%rbp), %rax
	movl	24(%rax), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, %rdi
	call	preorder
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, %rdi
	call	preorder
	jmp	.L44
.L47:
	nop
.L44:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	preorder, .-preorder
	.section	.rodata
.LC1:
	.string	"%d"
.LC2:
	.string	"%s"
.LC3:
	.string	"yes"
.LC4:
	.string	"no"
	.text
	.globl	main
	.type	main, @function
main:
.LFB14:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-52(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -44(%rbp)
	jmp	.L49
.L55:
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzbl	-32(%rbp), %eax
	cmpb	$102, %al
	jne	.L50
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %edx
	movq	root(%rip), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	treeSearch
	movq	%rax, -40(%rbp)
	cmpq	$0, -40(%rbp)
	je	.L51
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L52
.L51:
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L52
.L50:
	movzbl	-32(%rbp), %eax
	cmpb	$105, %al
	jne	.L53
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %eax
	movl	%eax, %edi
	call	insert
	jmp	.L52
.L53:
	movzbl	-32(%rbp), %eax
	cmpb	$112, %al
	jne	.L54
	movq	root(%rip), %rax
	movq	%rax, %rdi
	call	inorder
	movl	$10, %edi
	call	putchar@PLT
	movq	root(%rip), %rax
	movq	%rax, %rdi
	call	preorder
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L52
.L54:
	movzbl	-32(%rbp), %eax
	cmpb	$100, %al
	jne	.L52
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %edx
	movq	root(%rip), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	treeSearch
	movq	%rax, %rdi
	call	treeDelete
.L52:
	addl	$1, -44(%rbp)
.L49:
	movl	-52(%rbp), %eax
	cmpl	%eax, -44(%rbp)
	jl	.L55
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L57
	call	__stack_chk_fail@PLT
.L57:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.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	root
	.bss
	.align 8
	.type	root, @object
	.size	root, 8
root:
	.zero	8
	.text
	.globl	treeMinimum
	.type	treeMinimum, @function
treeMinimum:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	jmp	.L2
.L3:
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -8(%rbp)
.L2:
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	testq	%rax, %rax
	jne	.L3
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	treeMinimum, .-treeMinimum
	.globl	treeMaximum
	.type	treeMaximum, @function
treeMaximum:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	jmp	.L6
.L7:
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
.L6:
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	jne	.L7
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	treeMaximum, .-treeMaximum
	.globl	treeSearch
	.type	treeSearch, @function
treeSearch:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	jmp	.L10
.L13:
	movq	-8(%rbp), %rax
	movl	24(%rax), %eax
	cmpl	%eax, -12(%rbp)
	jge	.L11
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -8(%rbp)
	jmp	.L10
.L11:
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
.L10:
	cmpq	$0, -8(%rbp)
	je	.L12
	movq	-8(%rbp), %rax
	movl	24(%rax), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L13
.L12:
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	treeSearch, .-treeSearch
	.globl	treeSuccessor
	.type	treeSuccessor, @function
treeSuccessor:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$24, %rsp
	movq	%rdi, -24(%rbp)
	movq	-24(%rbp), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	.L16
	movq	-24(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, %rdi
	call	treeMinimum
	jmp	.L17
.L16:
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, -8(%rbp)
	jmp	.L18
.L20:
	movq	-8(%rbp), %rax
	movq	%rax, -24(%rbp)
	movq	-8(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, -8(%rbp)
.L18:
	cmpq	$0, -8(%rbp)
	je	.L19
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, -24(%rbp)
	je	.L20
.L19:
	movq	-8(%rbp), %rax
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	treeSuccessor, .-treeSuccessor
	.globl	treeDelete
	.type	treeDelete, @function
treeDelete:
.LFB10:
	.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	%rdi, -24(%rbp)
	movq	-24(%rbp), %rax
	movq	8(%rax), %rax
	testq	%rax, %rax
	je	.L22
	movq	-24(%rbp), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	jne	.L23
.L22:
	movq	-24(%rbp), %rax
	movq	%rax, -16(%rbp)
	jmp	.L24
.L23:
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	treeSuccessor
	movq	%rax, -16(%rbp)
.L24:
	movq	-16(%rbp), %rax
	movq	8(%rax), %rax
	testq	%rax, %rax
	je	.L25
	movq	-16(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -8(%rbp)
	jmp	.L26
.L25:
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
.L26:
	cmpq	$0, -8(%rbp)
	je	.L27
	movq	-16(%rbp), %rax
	movq	16(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 16(%rax)
.L27:
	movq	-16(%rbp), %rax
	movq	16(%rax), %rax
	testq	%rax, %rax
	jne	.L28
	movq	-8(%rbp), %rax
	movq	%rax, root(%rip)
	jmp	.L29
.L28:
	movq	-16(%rbp), %rax
	movq	16(%rax), %rax
	movq	8(%rax), %rax
	cmpq	%rax, -16(%rbp)
	jne	.L30
	movq	-16(%rbp), %rax
	movq	16(%rax), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, 8(%rax)
	jmp	.L29
.L30:
	movq	-16(%rbp), %rax
	movq	16(%rax), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, (%rax)
.L29:
	movq	-16(%rbp), %rax
	cmpq	-24(%rbp), %rax
	je	.L31
	movq	-16(%rbp), %rax
	movl	24(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, 24(%rax)
.L31:
	movq	-16(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	treeDelete, .-treeDelete
	.globl	insert
	.type	insert, @function
insert:
.LFB11:
	.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
	movl	%edi, -36(%rbp)
	movq	$0, -24(%rbp)
	movq	root(%rip), %rax
	movq	%rax, -16(%rbp)
	movl	$32, %edi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movl	-36(%rbp), %edx
	movl	%edx, 24(%rax)
	movq	-8(%rbp), %rax
	movq	$0, 8(%rax)
	movq	-8(%rbp), %rax
	movq	$0, (%rax)
	jmp	.L33
.L35:
	movq	-16(%rbp), %rax
	movq	%rax, -24(%rbp)
	movq	-8(%rbp), %rax
	movl	24(%rax), %edx
	movq	-16(%rbp), %rax
	movl	24(%rax), %eax
	cmpl	%eax, %edx
	jge	.L34
	movq	-16(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -16(%rbp)
	jmp	.L33
.L34:
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
.L33:
	cmpq	$0, -16(%rbp)
	jne	.L35
	movq	-8(%rbp), %rax
	movq	-24(%rbp), %rdx
	movq	%rdx, 16(%rax)
	cmpq	$0, -24(%rbp)
	jne	.L36
	movq	-8(%rbp), %rax
	movq	%rax, root(%rip)
	jmp	.L39
.L36:
	movq	-8(%rbp), %rax
	movl	24(%rax), %edx
	movq	-24(%rbp), %rax
	movl	24(%rax), %eax
	cmpl	%eax, %edx
	jge	.L38
	movq	-24(%rbp), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, 8(%rax)
	jmp	.L39
.L38:
	movq	-24(%rbp), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, (%rax)
.L39:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	insert, .-insert
	.section	.rodata
.LC0:
	.string	" %d"
	.text
	.globl	inorder
	.type	inorder, @function
inorder:
.LFB12:
	.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
	movq	%rdi, -8(%rbp)
	cmpq	$0, -8(%rbp)
	je	.L43
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, %rdi
	call	inorder
	movq	-8(%rbp), %rax
	movl	24(%rax), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, %rdi
	call	inorder
	jmp	.L40
.L43:
	nop
.L40:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	inorder, .-inorder
	.globl	preorder
	.type	preorder, @function
preorder:
.LFB13:
	.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
	movq	%rdi, -8(%rbp)
	cmpq	$0, -8(%rbp)
	je	.L47
	movq	-8(%rbp), %rax
	movl	24(%rax), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, %rdi
	call	preorder
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, %rdi
	call	preorder
	jmp	.L44
.L47:
	nop
.L44:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	preorder, .-preorder
	.section	.rodata
.LC1:
	.string	"%d"
.LC2:
	.string	"%s"
.LC3:
	.string	"yes"
.LC4:
	.string	"no"
	.text
	.globl	main
	.type	main, @function
main:
.LFB14:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-52(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -44(%rbp)
	jmp	.L49
.L55:
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzbl	-32(%rbp), %eax
	cmpb	$102, %al
	jne	.L50
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %edx
	movq	root(%rip), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	treeSearch
	movq	%rax, -40(%rbp)
	cmpq	$0, -40(%rbp)
	je	.L51
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L52
.L51:
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L52
.L50:
	movzbl	-32(%rbp), %eax
	cmpb	$105, %al
	jne	.L53
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %eax
	movl	%eax, %edi
	call	insert
	jmp	.L52
.L53:
	movzbl	-32(%rbp), %eax
	cmpb	$112, %al
	jne	.L54
	movq	root(%rip), %rax
	movq	%rax, %rdi
	call	inorder
	movl	$10, %edi
	call	putchar@PLT
	movq	root(%rip), %rax
	movq	%rax, %rdi
	call	preorder
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L52
.L54:
	movzbl	-32(%rbp), %eax
	cmpb	$100, %al
	jne	.L52
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %edx
	movq	root(%rip), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	treeSearch
	movq	%rax, %rdi
	call	treeDelete
.L52:
	addl	$1, -44(%rbp)
.L49:
	movl	-52(%rbp), %eax
	cmpl	%eax, -44(%rbp)
	jl	.L55
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L57
	call	__stack_chk_fail@PLT
.L57:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.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:
