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>
#define MAX 100

typedef struct node
{
    struct node *right;
    struct node *left;
    struct node *parent;
    int key;
} Node;

Node *root, *NIL;

void insert(int);
Node *find(int, Node *);
void inorder(Node *);
void preorder(Node *);
void delete(Node *);
Node *successor(Node *);
Node *min(Node *);

int main()
{
    int m, i, k, j, con;
    char com[MAX], judge[MAX];
    char y = 'y', n = 'n';

    scanf("%d", &m);
    for (i = 0; i < m; i++)
    {
        scanf("%s", com);
        if (com[0] == 'f')
        {
            scanf("%d", &k);
            Node *u = find(k, root);
            if (u != NIL)
            {
                printf("yes\n");
            }
            else
            {
                printf("no\n");
            }
        }
        else if (com[0] == 'i')
        {
            scanf("%d", &k);
            insert(k);
        }
        else if (com[0] == 'p')
        {
            inorder(root);
            printf("\n");
            preorder(root);
            printf("\n");
        }
        else if (com[0] == 'd')
        {
            scanf("%d",&k);
            delete(find(k,root));
        }
    }
    return 0;
}

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

    z = (Node *)malloc(sizeof(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; //insertした値の親を設定する
    if (y == NIL)
    { //親がない場合insertした値がそのままroot
        root = z;
    }
    else
    {
        if (z->key < y->key)
        {
            y->left = z;
        }
        else
        {
            y->right = z;
        }
    }
}

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

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);
}

void delete(Node *z)
{
    Node *y; //削除する対象
    Node *x;//yの子
    
    if(z->left == NIL || z->right == NIL){
        y=z;
    }else y = successor(z);

    // yの子xを決める
    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);
}

Node *successor(Node *x){
    if(x->right != NIL) return min(x->right);
    Node *y=x->parent;
    while(y!=NIL && x==y->right){
        x=y;
        y=y->parent;
    }
    return y;
}

Node *min(Node *x){
    while(x->left!=NIL)x = x->left;
    return x;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	root
	.bss
	.align 8
	.type	root, @object
	.size	root, 8
root:
	.zero	8
	.globl	NIL
	.align 8
	.type	NIL, @object
	.size	NIL, 8
NIL:
	.zero	8
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"yes"
.LC3:
	.string	"no"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$144, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movb	$121, -134(%rbp)
	movb	$110, -133(%rbp)
	leaq	-132(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -124(%rbp)
	jmp	.L2
.L8:
	leaq	-112(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzbl	-112(%rbp), %eax
	cmpb	$102, %al
	jne	.L3
	leaq	-128(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	root(%rip), %rdx
	movl	-128(%rbp), %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	find
	movq	%rax, -120(%rbp)
	movq	NIL(%rip), %rax
	cmpq	%rax, -120(%rbp)
	je	.L4
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L5
.L4:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L5
.L3:
	movzbl	-112(%rbp), %eax
	cmpb	$105, %al
	jne	.L6
	leaq	-128(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-128(%rbp), %eax
	movl	%eax, %edi
	call	insert
	jmp	.L5
.L6:
	movzbl	-112(%rbp), %eax
	cmpb	$112, %al
	jne	.L7
	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	.L5
.L7:
	movzbl	-112(%rbp), %eax
	cmpb	$100, %al
	jne	.L5
	leaq	-128(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	root(%rip), %rdx
	movl	-128(%rbp), %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	find
	movq	%rax, %rdi
	call	delete
.L5:
	addl	$1, -124(%rbp)
.L2:
	movl	-132(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L8
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	insert
	.type	insert, @function
insert:
.LFB7:
	.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	NIL(%rip), %rax
	movq	%rax, -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	NIL(%rip), %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 8(%rax)
	movq	NIL(%rip), %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, (%rax)
	jmp	.L12
.L14:
	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	.L13
	movq	-16(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -16(%rbp)
	jmp	.L12
.L13:
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
.L12:
	movq	NIL(%rip), %rax
	cmpq	%rax, -16(%rbp)
	jne	.L14
	movq	-8(%rbp), %rax
	movq	-24(%rbp), %rdx
	movq	%rdx, 16(%rax)
	movq	NIL(%rip), %rax
	cmpq	%rax, -24(%rbp)
	jne	.L15
	movq	-8(%rbp), %rax
	movq	%rax, root(%rip)
	jmp	.L18
.L15:
	movq	-8(%rbp), %rax
	movl	24(%rax), %edx
	movq	-24(%rbp), %rax
	movl	24(%rax), %eax
	cmpl	%eax, %edx
	jge	.L17
	movq	-24(%rbp), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, 8(%rax)
	jmp	.L18
.L17:
	movq	-24(%rbp), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, (%rax)
.L18:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	insert, .-insert
	.globl	find
	.type	find, @function
find:
.LFB8:
	.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)
	movq	%rsi, -16(%rbp)
	jmp	.L20
.L23:
	movq	-16(%rbp), %rax
	movl	24(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jge	.L21
	movq	-16(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -16(%rbp)
	jmp	.L20
.L21:
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
.L20:
	movq	NIL(%rip), %rax
	cmpq	%rax, -16(%rbp)
	je	.L22
	movq	-16(%rbp), %rax
	movl	24(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jne	.L23
.L22:
	movq	-16(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	find, .-find
	.section	.rodata
.LC4:
	.string	" %d"
	.text
	.globl	inorder
	.type	inorder, @function
inorder:
.LFB9:
	.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)
	movq	NIL(%rip), %rax
	cmpq	%rax, -8(%rbp)
	je	.L28
	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	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, %rdi
	call	inorder
	jmp	.L25
.L28:
	nop
.L25:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	inorder, .-inorder
	.globl	preorder
	.type	preorder, @function
preorder:
.LFB10:
	.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)
	movq	NIL(%rip), %rax
	cmpq	%rax, -8(%rbp)
	je	.L32
	movq	-8(%rbp), %rax
	movl	24(%rax), %eax
	movl	%eax, %esi
	leaq	.LC4(%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	.L29
.L32:
	nop
.L29:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	preorder, .-preorder
	.globl	delete
	.type	delete, @function
delete:
.LFB11:
	.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), %rdx
	movq	NIL(%rip), %rax
	cmpq	%rax, %rdx
	je	.L34
	movq	-24(%rbp), %rax
	movq	(%rax), %rdx
	movq	NIL(%rip), %rax
	cmpq	%rax, %rdx
	jne	.L35
.L34:
	movq	-24(%rbp), %rax
	movq	%rax, -16(%rbp)
	jmp	.L36
.L35:
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	successor
	movq	%rax, -16(%rbp)
.L36:
	movq	-16(%rbp), %rax
	movq	8(%rax), %rdx
	movq	NIL(%rip), %rax
	cmpq	%rax, %rdx
	je	.L37
	movq	-16(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -8(%rbp)
	jmp	.L38
.L37:
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
.L38:
	movq	NIL(%rip), %rax
	cmpq	%rax, -8(%rbp)
	je	.L39
	movq	-16(%rbp), %rax
	movq	16(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 16(%rax)
.L39:
	movq	-16(%rbp), %rax
	movq	16(%rax), %rdx
	movq	NIL(%rip), %rax
	cmpq	%rax, %rdx
	jne	.L40
	movq	-8(%rbp), %rax
	movq	%rax, root(%rip)
	jmp	.L41
.L40:
	movq	-16(%rbp), %rax
	movq	16(%rax), %rax
	movq	8(%rax), %rax
	cmpq	%rax, -16(%rbp)
	jne	.L42
	movq	-16(%rbp), %rax
	movq	16(%rax), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, 8(%rax)
	jmp	.L41
.L42:
	movq	-16(%rbp), %rax
	movq	16(%rax), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, (%rax)
.L41:
	movq	-16(%rbp), %rax
	cmpq	-24(%rbp), %rax
	je	.L43
	movq	-16(%rbp), %rax
	movl	24(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, 24(%rax)
.L43:
	movq	-16(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	delete, .-delete
	.globl	successor
	.type	successor, @function
successor:
.LFB12:
	.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	(%rax), %rdx
	movq	NIL(%rip), %rax
	cmpq	%rax, %rdx
	je	.L45
	movq	-24(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, %rdi
	call	min
	jmp	.L46
.L45:
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, -8(%rbp)
	jmp	.L47
.L49:
	movq	-8(%rbp), %rax
	movq	%rax, -24(%rbp)
	movq	-8(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, -8(%rbp)
.L47:
	movq	NIL(%rip), %rax
	cmpq	%rax, -8(%rbp)
	je	.L48
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, -24(%rbp)
	je	.L49
.L48:
	movq	-8(%rbp), %rax
.L46:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	successor, .-successor
	.globl	min
	.type	min, @function
min:
.LFB13:
	.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	.L51
.L52:
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -8(%rbp)
.L51:
	movq	-8(%rbp), %rax
	movq	8(%rax), %rdx
	movq	NIL(%rip), %rax
	cmpq	%rax, %rdx
	jne	.L52
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	min, .-min
	.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	insert
	.type	insert, @function
insert:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movl	%edi, %r12d
	movl	$32, %edi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	NIL(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	root(%rip), %rbx
	call	malloc@PLT
	movq	%rbp, %xmm0
	punpcklqdq	%xmm0, %xmm0
	movl	%r12d, 24(%rax)
	movups	%xmm0, (%rax)
	cmpq	%rbx, %rbp
	je	.L2
	.p2align 4,,10
	.p2align 3
.L7:
	movq	(%rbx), %rcx
	movq	8(%rbx), %rdx
	cmpl	%r12d, 24(%rbx)
	jle	.L3
.L19:
	cmpq	%rdx, %rbp
	je	.L18
	movq	%rdx, %rbx
	movq	(%rbx), %rcx
	movq	8(%rbx), %rdx
	cmpl	%r12d, 24(%rbx)
	jg	.L19
.L3:
	cmpq	%rcx, %rbp
	je	.L6
	movq	%rcx, %rbx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L18:
	movq	%rbx, 16(%rax)
	cmpq	%rbx, %rbp
	je	.L9
	movq	%rax, 8(%rbx)
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	movq	%rbx, 16(%rax)
	cmpq	%rbx, %rbp
	je	.L9
	movq	%rax, (%rbx)
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	movq	%rbp, 16(%rax)
.L9:
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	movq	%rax, root(%rip)
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE40:
	.size	insert, .-insert
	.p2align 4
	.globl	find
	.type	find, @function
find:
.LFB41:
	.cfi_startproc
	endbr64
	movq	NIL(%rip), %rax
	cmpq	%rax, %rsi
	jne	.L21
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L24:
	movq	(%rsi), %rdx
	cmovg	8(%rsi), %rdx
	movq	%rdx, %rsi
	cmpq	%rax, %rdx
	je	.L20
.L21:
	cmpl	%edi, 24(%rsi)
	jne	.L24
	movq	%rsi, %rax
.L20:
	ret
.L26:
	ret
	.cfi_endproc
.LFE41:
	.size	find, .-find
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	" %d"
	.text
	.p2align 4
	.globl	inorder
	.type	inorder, @function
inorder:
.LFB42:
	.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	NIL(%rip), %rax
	movq	%rdi, 16(%rsp)
	cmpq	%rax, %rdi
	je	.L27
	leaq	.LC0(%rip), %rbx
.L28:
	movq	16(%rsp), %rdi
	movq	8(%rdi), %rcx
	movq	%rcx, (%rsp)
	cmpq	%rax, %rcx
	je	.L32
.L29:
	movq	(%rsp), %rsi
	movq	8(%rsi), %rsi
	movq	%rsi, 8(%rsp)
	cmpq	%rax, %rsi
	je	.L34
.L31:
	movq	8(%rsp), %rdi
	movq	8(%rdi), %r15
	cmpq	%rax, %r15
	je	.L36
.L33:
	movq	8(%r15), %rbp
	cmpq	%rax, %rbp
	je	.L38
.L35:
	movq	8(%rbp), %r13
	cmpq	%rax, %r13
	je	.L40
.L37:
	movq	8(%r13), %r12
	cmpq	%rax, %r12
	je	.L42
.L39:
	movq	8(%r12), %r14
	cmpq	%rax, %r14
	je	.L44
.L41:
	movq	8(%r14), %r10
	cmpq	%rax, %r10
	je	.L45
.L43:
	movq	8(%r10), %rdi
	movq	%r10, 24(%rsp)
	call	inorder
	movq	24(%rsp), %r10
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movl	$1, %edi
	movl	24(%r10), %edx
	call	__printf_chk@PLT
	movq	24(%rsp), %r10
	movq	(%r10), %r10
	cmpq	%r10, NIL(%rip)
	jne	.L43
.L45:
	movl	24(%r14), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	(%r14), %r14
	movq	NIL(%rip), %rax
	cmpq	%r14, %rax
	jne	.L41
.L44:
	movl	24(%r12), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	(%r12), %r12
	movq	NIL(%rip), %rax
	cmpq	%r12, %rax
	jne	.L39
.L42:
	movl	24(%r13), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	0(%r13), %r13
	movq	NIL(%rip), %rax
	cmpq	%r13, %rax
	jne	.L37
.L40:
	movl	24(%rbp), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	0(%rbp), %rbp
	movq	NIL(%rip), %rax
	cmpq	%rbp, %rax
	jne	.L35
.L38:
	movl	24(%r15), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	(%r15), %r15
	movq	NIL(%rip), %rax
	cmpq	%r15, %rax
	jne	.L33
.L36:
	movq	8(%rsp), %r14
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	24(%r14), %edx
	call	__printf_chk@PLT
	movq	(%r14), %rcx
	movq	NIL(%rip), %rax
	movq	%rcx, 8(%rsp)
	cmpq	%rcx, %rax
	jne	.L31
.L34:
	movq	(%rsp), %r15
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	24(%r15), %edx
	call	__printf_chk@PLT
	movq	(%r15), %rcx
	movq	NIL(%rip), %rax
	movq	%rcx, (%rsp)
	cmpq	%rcx, %rax
	jne	.L29
.L32:
	movq	16(%rsp), %r15
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	24(%r15), %edx
	call	__printf_chk@PLT
	movq	(%r15), %rcx
	movq	NIL(%rip), %rax
	movq	%rcx, 16(%rsp)
	cmpq	%rcx, %rax
	jne	.L28
.L27:
	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
.LFE42:
	.size	inorder, .-inorder
	.p2align 4
	.globl	preorder
	.type	preorder, @function
preorder:
.LFB43:
	.cfi_startproc
	endbr64
	cmpq	NIL(%rip), %rdi
	je	.L89
	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
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
.L58:
	movl	24(%rbp), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%rbp), %rax
	movq	NIL(%rip), %r13
	movq	%rax, (%rsp)
	cmpq	%r13, %rax
	je	.L59
.L74:
	movq	(%rsp), %r14
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	24(%r14), %edx
	call	__printf_chk@PLT
	movq	8(%r14), %rax
	movq	NIL(%rip), %r13
	movq	%rax, 8(%rsp)
	cmpq	%r13, %rax
	je	.L60
.L73:
	movq	8(%rsp), %r15
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	24(%r15), %edx
	call	__printf_chk@PLT
	movq	8(%r15), %rax
	movq	NIL(%rip), %r13
	movq	%rax, 16(%rsp)
	cmpq	%r13, %rax
	je	.L61
.L72:
	movq	16(%rsp), %r14
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	24(%r14), %edx
	call	__printf_chk@PLT
	movq	8(%r14), %r14
	movq	NIL(%rip), %r13
	cmpq	%r13, %r14
	je	.L62
.L71:
	movl	24(%r14), %edx
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%r14), %r15
	cmpq	%r15, NIL(%rip)
	movq	%r15, %r13
	je	.L63
.L70:
	movl	24(%r15), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%r15), %r12
	movq	NIL(%rip), %r13
	cmpq	%r13, %r12
	je	.L64
.L69:
	movl	24(%r12), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%r12), %rax
	movq	NIL(%rip), %r13
	cmpq	%r13, %rax
	je	.L65
	movq	%rax, %r13
.L68:
	movl	24(%r13), %edx
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%r13), %r10
	cmpq	NIL(%rip), %r10
	je	.L66
.L67:
	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
	cmpq	%r10, NIL(%rip)
	jne	.L67
.L66:
	movq	0(%r13), %r13
	cmpq	%r13, %r10
	jne	.L68
.L65:
	movq	(%r12), %r12
	cmpq	%r13, %r12
	jne	.L69
.L64:
	movq	(%r15), %r15
	cmpq	%r13, %r15
	jne	.L70
.L63:
	movq	(%r14), %r14
	cmpq	%r13, %r14
	jne	.L71
.L62:
	movq	16(%rsp), %rax
	movq	(%rax), %rax
	movq	%rax, 16(%rsp)
	cmpq	%r13, %rax
	jne	.L72
.L61:
	movq	8(%rsp), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%rsp)
	cmpq	%r13, %rax
	jne	.L73
.L60:
	movq	(%rsp), %rax
	movq	(%rax), %rax
	movq	%rax, (%rsp)
	cmpq	%r13, %rax
	jne	.L74
.L59:
	movq	0(%rbp), %rbp
	cmpq	%r13, %rbp
	jne	.L58
	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
.L89:
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	.cfi_restore 15
	ret
	.cfi_endproc
.LFE43:
	.size	preorder, .-preorder
	.p2align 4
	.globl	delete
	.type	delete, @function
delete:
.LFB44:
	.cfi_startproc
	endbr64
	movq	8(%rdi), %rsi
	movq	NIL(%rip), %rdx
	movq	%rdi, %rcx
	movq	(%rdi), %rax
	cmpq	%rdx, %rsi
	je	.L93
	cmpq	%rax, %rdx
	je	.L94
	.p2align 4,,10
	.p2align 3
.L95:
	movq	%rax, %rdi
	movq	8(%rax), %rax
	cmpq	%rax, %rdx
	jne	.L95
.L93:
	movq	(%rdi), %rsi
	cmpq	%rsi, %rdx
	je	.L100
	.p2align 4,,10
	.p2align 3
.L94:
	movq	16(%rdi), %rax
	movq	%rax, 16(%rsi)
.L100:
	movq	16(%rdi), %rax
	cmpq	%rax, %rdx
	je	.L104
	cmpq	%rdi, 8(%rax)
	je	.L105
	movq	%rsi, (%rax)
.L97:
	cmpq	%rdi, %rcx
	je	.L99
	movl	24(%rdi), %eax
	movl	%eax, 24(%rcx)
.L99:
	jmp	free@PLT
	.p2align 4,,10
	.p2align 3
.L105:
	movq	%rsi, 8(%rax)
	jmp	.L97
	.p2align 4,,10
	.p2align 3
.L104:
	movq	%rsi, root(%rip)
	jmp	.L97
	.cfi_endproc
.LFE44:
	.size	delete, .-delete
	.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:
.LFB39:
	.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	$136, %rsp
	.cfi_def_cfa_offset 192
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L107
	xorl	%ebx, %ebx
	leaq	16(%rsp), %r12
	leaq	.LC2(%rip), %rbp
	leaq	12(%rsp), %r14
	leaq	.LC3(%rip), %r15
	jmp	.L121
	.p2align 4,,10
	.p2align 3
.L114:
	cmpb	$112, %al
	je	.L129
	cmpb	$100, %al
	je	.L130
.L115:
	addl	$1, %ebx
	cmpl	%ebx, 8(%rsp)
	jle	.L107
.L121:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movzbl	16(%rsp), %eax
	cmpb	$102, %al
	je	.L131
	cmpb	$105, %al
	jne	.L114
	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	.L121
	.p2align 4,,10
	.p2align 3
.L107:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L132
	addq	$136, %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
.L129:
	.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	.L115
	.p2align 4,,10
	.p2align 3
.L131:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	root(%rip), %rax
	movq	NIL(%rip), %rcx
	movl	12(%rsp), %esi
	cmpq	%rcx, %rax
	jne	.L109
	jmp	.L110
	.p2align 4,,10
	.p2align 3
.L112:
	movq	(%rax), %rdx
	cmovl	8(%rax), %rdx
	movq	%rdx, %rax
	cmpq	%rcx, %rdx
	je	.L110
.L109:
	cmpl	24(%rax), %esi
	jne	.L112
	movq	%r15, %rdi
	call	puts@PLT
	jmp	.L115
.L130:
	movq	%r13, %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	root(%rip), %rdi
	movq	NIL(%rip), %rdx
	movl	12(%rsp), %ecx
	cmpq	%rdi, %rdx
	jne	.L117
	jmp	.L118
	.p2align 4,,10
	.p2align 3
.L120:
	movq	(%rdi), %rax
	cmovl	8(%rdi), %rax
	movq	%rax, %rdi
	cmpq	%rax, %rdx
	je	.L118
.L117:
	cmpl	24(%rdi), %ecx
	jne	.L120
.L118:
	call	delete
	jmp	.L115
.L110:
	leaq	.LC4(%rip), %rdi
	call	puts@PLT
	jmp	.L115
.L132:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.text
	.p2align 4
	.globl	successor
	.type	successor, @function
successor:
.LFB45:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rdx
	movq	NIL(%rip), %rcx
	cmpq	%rcx, %rdx
	je	.L134
	.p2align 4,,10
	.p2align 3
.L135:
	movq	%rdx, %rax
	movq	8(%rdx), %rdx
	cmpq	%rdx, %rcx
	jne	.L135
	ret
	.p2align 4,,10
	.p2align 3
.L134:
	movq	16(%rdi), %rax
	cmpq	%rax, %rcx
	jne	.L137
	jmp	.L142
	.p2align 4,,10
	.p2align 3
.L138:
	movq	16(%rax), %rdx
	movq	%rax, %rdi
	cmpq	%rdx, %rcx
	je	.L139
	movq	%rdx, %rax
.L137:
	cmpq	%rdi, (%rax)
	je	.L138
	ret
	.p2align 4,,10
	.p2align 3
.L139:
	movq	%rcx, %rax
	ret
.L142:
	ret
	.cfi_endproc
.LFE45:
	.size	successor, .-successor
	.p2align 4
	.globl	min
	.type	min, @function
min:
.LFB46:
	.cfi_startproc
	endbr64
	movq	NIL(%rip), %rdx
	.p2align 4,,10
	.p2align 3
.L144:
	movq	%rdi, %rax
	movq	8(%rdi), %rdi
	cmpq	%rdx, %rdi
	jne	.L144
	ret
	.cfi_endproc
.LFE46:
	.size	min, .-min
	.globl	NIL
	.bss
	.align 8
	.type	NIL, @object
	.size	NIL, 8
NIL:
	.zero	8
	.globl	root
	.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	insert
	.type	insert, @function
insert:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movl	%edi, %r12d
	movl	$32, %edi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	NIL(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	root(%rip), %rbx
	call	malloc@PLT
	movq	%rbp, %xmm0
	punpcklqdq	%xmm0, %xmm0
	movl	%r12d, 24(%rax)
	movups	%xmm0, (%rax)
	cmpq	%rbx, %rbp
	je	.L2
	.p2align 4,,10
	.p2align 3
.L7:
	movq	(%rbx), %rcx
	movq	8(%rbx), %rdx
	cmpl	%r12d, 24(%rbx)
	jle	.L3
.L19:
	cmpq	%rdx, %rbp
	je	.L18
	movq	%rdx, %rbx
	movq	(%rbx), %rcx
	movq	8(%rbx), %rdx
	cmpl	%r12d, 24(%rbx)
	jg	.L19
.L3:
	cmpq	%rcx, %rbp
	je	.L6
	movq	%rcx, %rbx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L18:
	movq	%rbx, 16(%rax)
	cmpq	%rbx, %rbp
	je	.L9
	movq	%rax, 8(%rbx)
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	movq	%rbx, 16(%rax)
	cmpq	%rbx, %rbp
	je	.L9
	movq	%rax, (%rbx)
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	movq	%rbp, 16(%rax)
.L9:
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	movq	%rax, root(%rip)
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE40:
	.size	insert, .-insert
	.p2align 4
	.globl	find
	.type	find, @function
find:
.LFB41:
	.cfi_startproc
	endbr64
	movq	NIL(%rip), %rax
	cmpq	%rax, %rsi
	jne	.L21
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L24:
	movq	(%rsi), %rdx
	cmovg	8(%rsi), %rdx
	movq	%rdx, %rsi
	cmpq	%rax, %rdx
	je	.L20
.L21:
	cmpl	%edi, 24(%rsi)
	jne	.L24
	movq	%rsi, %rax
.L20:
	ret
.L26:
	ret
	.cfi_endproc
.LFE41:
	.size	find, .-find
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	" %d"
	.text
	.p2align 4
	.globl	inorder
	.type	inorder, @function
inorder:
.LFB42:
	.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	NIL(%rip), %rax
	movq	%rdi, 16(%rsp)
	cmpq	%rax, %rdi
	je	.L27
	leaq	.LC0(%rip), %rbx
.L28:
	movq	16(%rsp), %rdi
	movq	8(%rdi), %rcx
	movq	%rcx, (%rsp)
	cmpq	%rax, %rcx
	je	.L32
.L29:
	movq	(%rsp), %rsi
	movq	8(%rsi), %rsi
	movq	%rsi, 8(%rsp)
	cmpq	%rax, %rsi
	je	.L34
.L31:
	movq	8(%rsp), %rdi
	movq	8(%rdi), %r15
	cmpq	%rax, %r15
	je	.L36
.L33:
	movq	8(%r15), %rbp
	cmpq	%rax, %rbp
	je	.L38
.L35:
	movq	8(%rbp), %r13
	cmpq	%rax, %r13
	je	.L40
.L37:
	movq	8(%r13), %r12
	cmpq	%rax, %r12
	je	.L42
.L39:
	movq	8(%r12), %r14
	cmpq	%rax, %r14
	je	.L44
.L41:
	movq	8(%r14), %r10
	cmpq	%rax, %r10
	je	.L45
.L43:
	movq	8(%r10), %rdi
	movq	%r10, 24(%rsp)
	call	inorder
	movq	24(%rsp), %r10
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movl	$1, %edi
	movl	24(%r10), %edx
	call	__printf_chk@PLT
	movq	24(%rsp), %r10
	movq	(%r10), %r10
	cmpq	%r10, NIL(%rip)
	jne	.L43
.L45:
	movl	24(%r14), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	(%r14), %r14
	movq	NIL(%rip), %rax
	cmpq	%r14, %rax
	jne	.L41
.L44:
	movl	24(%r12), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	(%r12), %r12
	movq	NIL(%rip), %rax
	cmpq	%r12, %rax
	jne	.L39
.L42:
	movl	24(%r13), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	0(%r13), %r13
	movq	NIL(%rip), %rax
	cmpq	%r13, %rax
	jne	.L37
.L40:
	movl	24(%rbp), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	0(%rbp), %rbp
	movq	NIL(%rip), %rax
	cmpq	%rbp, %rax
	jne	.L35
.L38:
	movl	24(%r15), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	(%r15), %r15
	movq	NIL(%rip), %rax
	cmpq	%r15, %rax
	jne	.L33
.L36:
	movq	8(%rsp), %r14
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	24(%r14), %edx
	call	__printf_chk@PLT
	movq	(%r14), %rcx
	movq	NIL(%rip), %rax
	movq	%rcx, 8(%rsp)
	cmpq	%rcx, %rax
	jne	.L31
.L34:
	movq	(%rsp), %r15
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	24(%r15), %edx
	call	__printf_chk@PLT
	movq	(%r15), %rcx
	movq	NIL(%rip), %rax
	movq	%rcx, (%rsp)
	cmpq	%rcx, %rax
	jne	.L29
.L32:
	movq	16(%rsp), %r15
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	24(%r15), %edx
	call	__printf_chk@PLT
	movq	(%r15), %rcx
	movq	NIL(%rip), %rax
	movq	%rcx, 16(%rsp)
	cmpq	%rcx, %rax
	jne	.L28
.L27:
	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
.LFE42:
	.size	inorder, .-inorder
	.p2align 4
	.globl	preorder
	.type	preorder, @function
preorder:
.LFB43:
	.cfi_startproc
	endbr64
	cmpq	NIL(%rip), %rdi
	je	.L89
	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
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
.L58:
	movl	24(%rbp), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%rbp), %rax
	movq	NIL(%rip), %r13
	movq	%rax, (%rsp)
	cmpq	%r13, %rax
	je	.L59
.L74:
	movq	(%rsp), %r14
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	24(%r14), %edx
	call	__printf_chk@PLT
	movq	8(%r14), %rax
	movq	NIL(%rip), %r13
	movq	%rax, 8(%rsp)
	cmpq	%r13, %rax
	je	.L60
.L73:
	movq	8(%rsp), %r15
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	24(%r15), %edx
	call	__printf_chk@PLT
	movq	8(%r15), %rax
	movq	NIL(%rip), %r13
	movq	%rax, 16(%rsp)
	cmpq	%r13, %rax
	je	.L61
.L72:
	movq	16(%rsp), %r14
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	24(%r14), %edx
	call	__printf_chk@PLT
	movq	8(%r14), %r14
	movq	NIL(%rip), %r13
	cmpq	%r13, %r14
	je	.L62
.L71:
	movl	24(%r14), %edx
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%r14), %r15
	cmpq	%r15, NIL(%rip)
	movq	%r15, %r13
	je	.L63
.L70:
	movl	24(%r15), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%r15), %r12
	movq	NIL(%rip), %r13
	cmpq	%r13, %r12
	je	.L64
.L69:
	movl	24(%r12), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%r12), %rax
	movq	NIL(%rip), %r13
	cmpq	%r13, %rax
	je	.L65
	movq	%rax, %r13
.L68:
	movl	24(%r13), %edx
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%r13), %r10
	cmpq	NIL(%rip), %r10
	je	.L66
.L67:
	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
	cmpq	%r10, NIL(%rip)
	jne	.L67
.L66:
	movq	0(%r13), %r13
	cmpq	%r13, %r10
	jne	.L68
.L65:
	movq	(%r12), %r12
	cmpq	%r13, %r12
	jne	.L69
.L64:
	movq	(%r15), %r15
	cmpq	%r13, %r15
	jne	.L70
.L63:
	movq	(%r14), %r14
	cmpq	%r13, %r14
	jne	.L71
.L62:
	movq	16(%rsp), %rax
	movq	(%rax), %rax
	movq	%rax, 16(%rsp)
	cmpq	%r13, %rax
	jne	.L72
.L61:
	movq	8(%rsp), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%rsp)
	cmpq	%r13, %rax
	jne	.L73
.L60:
	movq	(%rsp), %rax
	movq	(%rax), %rax
	movq	%rax, (%rsp)
	cmpq	%r13, %rax
	jne	.L74
.L59:
	movq	0(%rbp), %rbp
	cmpq	%r13, %rbp
	jne	.L58
	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
.L89:
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	.cfi_restore 15
	ret
	.cfi_endproc
.LFE43:
	.size	preorder, .-preorder
	.p2align 4
	.globl	delete
	.type	delete, @function
delete:
.LFB44:
	.cfi_startproc
	endbr64
	movq	8(%rdi), %rsi
	movq	NIL(%rip), %rdx
	movq	%rdi, %rcx
	movq	(%rdi), %rax
	cmpq	%rdx, %rsi
	je	.L93
	cmpq	%rax, %rdx
	je	.L94
	.p2align 4,,10
	.p2align 3
.L95:
	movq	%rax, %rdi
	movq	8(%rax), %rax
	cmpq	%rax, %rdx
	jne	.L95
.L93:
	movq	(%rdi), %rsi
	cmpq	%rsi, %rdx
	je	.L100
	.p2align 4,,10
	.p2align 3
.L94:
	movq	16(%rdi), %rax
	movq	%rax, 16(%rsi)
.L100:
	movq	16(%rdi), %rax
	cmpq	%rax, %rdx
	je	.L104
	cmpq	%rdi, 8(%rax)
	je	.L105
	movq	%rsi, (%rax)
.L97:
	cmpq	%rdi, %rcx
	je	.L99
	movl	24(%rdi), %eax
	movl	%eax, 24(%rcx)
.L99:
	jmp	free@PLT
	.p2align 4,,10
	.p2align 3
.L105:
	movq	%rsi, 8(%rax)
	jmp	.L97
	.p2align 4,,10
	.p2align 3
.L104:
	movq	%rsi, root(%rip)
	jmp	.L97
	.cfi_endproc
.LFE44:
	.size	delete, .-delete
	.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:
.LFB39:
	.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	$136, %rsp
	.cfi_def_cfa_offset 192
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L107
	xorl	%ebx, %ebx
	leaq	16(%rsp), %r12
	leaq	.LC2(%rip), %rbp
	leaq	12(%rsp), %r14
	leaq	.LC3(%rip), %r15
	jmp	.L121
	.p2align 4,,10
	.p2align 3
.L114:
	cmpb	$112, %al
	je	.L129
	cmpb	$100, %al
	je	.L130
.L115:
	addl	$1, %ebx
	cmpl	%ebx, 8(%rsp)
	jle	.L107
.L121:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movzbl	16(%rsp), %eax
	cmpb	$102, %al
	je	.L131
	cmpb	$105, %al
	jne	.L114
	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	.L121
	.p2align 4,,10
	.p2align 3
.L107:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L132
	addq	$136, %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
.L129:
	.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	.L115
	.p2align 4,,10
	.p2align 3
.L131:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	root(%rip), %rax
	movq	NIL(%rip), %rcx
	movl	12(%rsp), %esi
	cmpq	%rcx, %rax
	jne	.L109
	jmp	.L110
	.p2align 4,,10
	.p2align 3
.L112:
	movq	(%rax), %rdx
	cmovl	8(%rax), %rdx
	movq	%rdx, %rax
	cmpq	%rcx, %rdx
	je	.L110
.L109:
	cmpl	24(%rax), %esi
	jne	.L112
	movq	%r15, %rdi
	call	puts@PLT
	jmp	.L115
.L130:
	movq	%r13, %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	root(%rip), %rdi
	movq	NIL(%rip), %rdx
	movl	12(%rsp), %ecx
	cmpq	%rdi, %rdx
	jne	.L117
	jmp	.L118
	.p2align 4,,10
	.p2align 3
.L120:
	movq	(%rdi), %rax
	cmovl	8(%rdi), %rax
	movq	%rax, %rdi
	cmpq	%rax, %rdx
	je	.L118
.L117:
	cmpl	24(%rdi), %ecx
	jne	.L120
.L118:
	call	delete
	jmp	.L115
.L110:
	leaq	.LC4(%rip), %rdi
	call	puts@PLT
	jmp	.L115
.L132:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.text
	.p2align 4
	.globl	successor
	.type	successor, @function
successor:
.LFB45:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rdx
	movq	NIL(%rip), %rcx
	cmpq	%rcx, %rdx
	je	.L134
	.p2align 4,,10
	.p2align 3
.L135:
	movq	%rdx, %rax
	movq	8(%rdx), %rdx
	cmpq	%rdx, %rcx
	jne	.L135
	ret
	.p2align 4,,10
	.p2align 3
.L134:
	movq	16(%rdi), %rax
	cmpq	%rax, %rcx
	jne	.L137
	jmp	.L142
	.p2align 4,,10
	.p2align 3
.L138:
	movq	16(%rax), %rdx
	movq	%rax, %rdi
	cmpq	%rdx, %rcx
	je	.L139
	movq	%rdx, %rax
.L137:
	cmpq	%rdi, (%rax)
	je	.L138
	ret
	.p2align 4,,10
	.p2align 3
.L139:
	movq	%rcx, %rax
	ret
.L142:
	ret
	.cfi_endproc
.LFE45:
	.size	successor, .-successor
	.p2align 4
	.globl	min
	.type	min, @function
min:
.LFB46:
	.cfi_startproc
	endbr64
	movq	NIL(%rip), %rdx
	.p2align 4,,10
	.p2align 3
.L144:
	movq	%rdi, %rax
	movq	8(%rdi), %rdi
	cmpq	%rdx, %rdi
	jne	.L144
	ret
	.cfi_endproc
.LFE46:
	.size	min, .-min
	.globl	NIL
	.bss
	.align 8
	.type	NIL, @object
	.size	NIL, 8
NIL:
	.zero	8
	.globl	root
	.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>
#define MAX 100

typedef struct node
{
    struct node *right;
    struct node *left;
    struct node *parent;
    int key;
} Node;

Node *root, *NIL;

void insert(int);
Node *find(int, Node *);
void inorder(Node *);
void preorder(Node *);
void delete(Node *);
Node *successor(Node *);
Node *min(Node *);

int main()
{
    int m, i, k, j, con;
    char com[MAX], judge[MAX];
    char y = 'y', n = 'n';

    scanf("%d", &m);
    for (i = 0; i < m; i++)
    {
        scanf("%s", com);
        if (com[0] == 'f')
        {
            scanf("%d", &k);
            Node *u = find(k, root);
            if (u != NIL)
            {
                printf("yes\n");
            }
            else
            {
                printf("no\n");
            }
        }
        else if (com[0] == 'i')
        {
            scanf("%d", &k);
            insert(k);
        }
        else if (com[0] == 'p')
        {
            inorder(root);
            printf("\n");
            preorder(root);
            printf("\n");
        }
        else if (com[0] == 'd')
        {
            scanf("%d",&k);
            delete(find(k,root));
        }
    }
    return 0;
}

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

    z = (Node *)malloc(sizeof(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; //insertした値の親を設定する
    if (y == NIL)
    { //親がない場合insertした値がそのままroot
        root = z;
    }
    else
    {
        if (z->key < y->key)
        {
            y->left = z;
        }
        else
        {
            y->right = z;
        }
    }
}

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

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);
}

void delete(Node *z)
{
    Node *y; //削除する対象
    Node *x;//yの子
    
    if(z->left == NIL || z->right == NIL){
        y=z;
    }else y = successor(z);

    // yの子xを決める
    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);
}

Node *successor(Node *x){
    if(x->right != NIL) return min(x->right);
    Node *y=x->parent;
    while(y!=NIL && x==y->right){
        x=y;
        y=y->parent;
    }
    return y;
}

Node *min(Node *x){
    while(x->left!=NIL)x = x->left;
    return x;
}

18
insert 8
insert 2
insert 3
insert 7
insert 22
insert 1
find 1
find 2
find 1
find 4
find 5
find 6
find 7
find 8
print
delete 3
delete 7
print
 18
insert 8
insert 2
insert 3
insert 7
insert 22
insert 1
find 1
find 2
find 3
find 4
find 5
find 6
find 4
find 7
print
delete 3
delete 7
print
 18
insert 8
insert 2
insert 3
insert 7
insert 22
insert 1
find 1
find 2
find 3
find 7
find 5
find 6
find 4
find 7
print
delete 3
delete 7
print
 18
insert 8
insert 2
insert 3
insert 7
insert 22
insert 1
find 1
find 2
find 3
find 4
find 5
find 7
find 4
find 7
print
delete 3
delete 7
print
 18
insert 8
insert 2
insert 3
insert 7
insert 22
insert 1
find 1
find 2
find 3
find 4
find 5
find 6
find 7
find 5
print
delete 3
delete 7
print
 18
insert 8
insert 2
insert 3
insert 7
insert 22
insert 1
find 1
find 1
find 3
find 4
find 2
find 6
find 7
find 7
print
delete 3
delete 7
print
 18
insert 8
insert 2
insert 3
insert 7
insert 22
insert 1
find 0
find 2
find 3
find 4
find 5
find 6
find 7
find 5
print
delete 3
delete 7
print
 18
insert 9
insert 2
insert 3
insert 7
insert 22
insert 1
find 1
find 1
find 3
find 4
find 2
find 6
find 7
find 7
print
delete 3
delete 7
print
 18
insert 8
insert 4
insert 3
insert 7
insert 22
insert 1
find 1
find 2
find 1
find 4
find 5
find 6
find 7
find 8
print
delete 3
delete 7
print
 18
insert 8
insert 2
insert 3
insert 7
insert 22
insert 1
find 1
find 1
find 0
find 4
find 5
find 6
find 4
find 7
print
delete 3
delete 7
print

yes
yes
yes
no
no
no
yes
yes
 1 2 3 7 8 22
 8 2 1 3 7 22
 1 2 8 22
 8 2 1 22
 yes
yes
yes
no
no
no
no
yes
 1 2 3 7 8 22
 8 2 1 3 7 22
 1 2 8 22
 8 2 1 22
 yes
yes
yes
yes
no
no
no
yes
 1 2 3 7 8 22
 8 2 1 3 7 22
 1 2 8 22
 8 2 1 22
 yes
yes
yes
no
no
yes
no
yes
 1 2 3 7 8 22
 8 2 1 3 7 22
 1 2 8 22
 8 2 1 22
 yes
yes
yes
no
no
no
yes
no
 1 2 3 7 8 22
 8 2 1 3 7 22
 1 2 8 22
 8 2 1 22
 yes
yes
yes
no
yes
no
yes
yes
 1 2 3 7 8 22
 8 2 1 3 7 22
 1 2 8 22
 8 2 1 22
 no
yes
yes
no
no
no
yes
no
 1 2 3 7 8 22
 8 2 1 3 7 22
 1 2 8 22
 8 2 1 22
 yes
yes
yes
no
yes
no
yes
yes
 1 2 3 7 9 22
 9 2 1 3 7 22
 1 2 9 22
 9 2 1 22
 yes
no
yes
yes
no
no
yes
yes
 1 3 4 7 8 22
 8 4 3 1 7 22
 1 4 8 22
 8 4 1 22
 yes
yes
no
no
no
no
no
yes
 1 2 3 7 8 22
 8 2 1 3 7 22
 1 2 8 22
 8 2 1 22

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>
#define MAX 100

typedef struct node
{
    struct node *right;
    struct node *left;
    struct node *parent;
    int key;
} Node;

Node *root, *NIL;

void insert(int);
Node *find(int, Node *);
void inorder(Node *);
void preorder(Node *);
void delete(Node *);
Node *successor(Node *);
Node *min(Node *);

int main()
{
    int m, i, k, j, con;
    char com[MAX], judge[MAX];
    char y = 'y', n = 'n';

    scanf("%d", &m);
    for (i = 0; i < m; i++)
    {
        scanf("%s", com);
        if (com[0] == 'f')
        {
            scanf("%d", &k);
            Node *u = find(k, root);
            if (u != NIL)
            {
                printf("yes\n");
            }
            else
            {
                printf("no\n");
            }
        }
        else if (com[0] == 'i')
        {
            scanf("%d", &k);
            insert(k);
        }
        else if (com[0] == 'p')
        {
            inorder(root);
            printf("\n");
            preorder(root);
            printf("\n");
        }
        else if (com[0] == 'd')
        {
            scanf("%d",&k);
            delete(find(k,root));
        }
    }
    return 0;
}

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

    z = (Node *)malloc(sizeof(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; //insertした値の親を設定する
    if (y == NIL)
    { //親がない場合insertした値がそのままroot
        root = z;
    }
    else
    {
        if (z->key < y->key)
        {
            y->left = z;
        }
        else
        {
            y->right = z;
        }
    }
}

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

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);
}

void delete(Node *z)
{
    Node *y; //削除する対象
    Node *x;//yの子
    
    if(z->left == NIL || z->right == NIL){
        y=z;
    }else y = successor(z);

    // yの子xを決める
    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);
}

Node *successor(Node *x){
    if(x->right != NIL) return min(x->right);
    Node *y=x->parent;
    while(y!=NIL && x==y->right){
        x=y;
        y=y->parent;
    }
    return y;
}

Node *min(Node *x){
    while(x->left!=NIL)x = x->left;
    return x;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	root
	.bss
	.align 8
	.type	root, @object
	.size	root, 8
root:
	.zero	8
	.globl	NIL
	.align 8
	.type	NIL, @object
	.size	NIL, 8
NIL:
	.zero	8
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"yes"
.LC3:
	.string	"no"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$144, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movb	$121, -134(%rbp)
	movb	$110, -133(%rbp)
	leaq	-132(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -124(%rbp)
	jmp	.L2
.L8:
	leaq	-112(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzbl	-112(%rbp), %eax
	cmpb	$102, %al
	jne	.L3
	leaq	-128(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	root(%rip), %rdx
	movl	-128(%rbp), %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	find
	movq	%rax, -120(%rbp)
	movq	NIL(%rip), %rax
	cmpq	%rax, -120(%rbp)
	je	.L4
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L5
.L4:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L5
.L3:
	movzbl	-112(%rbp), %eax
	cmpb	$105, %al
	jne	.L6
	leaq	-128(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-128(%rbp), %eax
	movl	%eax, %edi
	call	insert
	jmp	.L5
.L6:
	movzbl	-112(%rbp), %eax
	cmpb	$112, %al
	jne	.L7
	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	.L5
.L7:
	movzbl	-112(%rbp), %eax
	cmpb	$100, %al
	jne	.L5
	leaq	-128(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	root(%rip), %rdx
	movl	-128(%rbp), %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	find
	movq	%rax, %rdi
	call	delete
.L5:
	addl	$1, -124(%rbp)
.L2:
	movl	-132(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L8
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	insert
	.type	insert, @function
insert:
.LFB7:
	.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	NIL(%rip), %rax
	movq	%rax, -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	NIL(%rip), %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 8(%rax)
	movq	NIL(%rip), %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, (%rax)
	jmp	.L12
.L14:
	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	.L13
	movq	-16(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -16(%rbp)
	jmp	.L12
.L13:
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
.L12:
	movq	NIL(%rip), %rax
	cmpq	%rax, -16(%rbp)
	jne	.L14
	movq	-8(%rbp), %rax
	movq	-24(%rbp), %rdx
	movq	%rdx, 16(%rax)
	movq	NIL(%rip), %rax
	cmpq	%rax, -24(%rbp)
	jne	.L15
	movq	-8(%rbp), %rax
	movq	%rax, root(%rip)
	jmp	.L18
.L15:
	movq	-8(%rbp), %rax
	movl	24(%rax), %edx
	movq	-24(%rbp), %rax
	movl	24(%rax), %eax
	cmpl	%eax, %edx
	jge	.L17
	movq	-24(%rbp), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, 8(%rax)
	jmp	.L18
.L17:
	movq	-24(%rbp), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, (%rax)
.L18:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	insert, .-insert
	.globl	find
	.type	find, @function
find:
.LFB8:
	.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)
	movq	%rsi, -16(%rbp)
	jmp	.L20
.L23:
	movq	-16(%rbp), %rax
	movl	24(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jge	.L21
	movq	-16(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -16(%rbp)
	jmp	.L20
.L21:
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
.L20:
	movq	NIL(%rip), %rax
	cmpq	%rax, -16(%rbp)
	je	.L22
	movq	-16(%rbp), %rax
	movl	24(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jne	.L23
.L22:
	movq	-16(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	find, .-find
	.section	.rodata
.LC4:
	.string	" %d"
	.text
	.globl	inorder
	.type	inorder, @function
inorder:
.LFB9:
	.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)
	movq	NIL(%rip), %rax
	cmpq	%rax, -8(%rbp)
	je	.L28
	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	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, %rdi
	call	inorder
	jmp	.L25
.L28:
	nop
.L25:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	inorder, .-inorder
	.globl	preorder
	.type	preorder, @function
preorder:
.LFB10:
	.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)
	movq	NIL(%rip), %rax
	cmpq	%rax, -8(%rbp)
	je	.L32
	movq	-8(%rbp), %rax
	movl	24(%rax), %eax
	movl	%eax, %esi
	leaq	.LC4(%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	.L29
.L32:
	nop
.L29:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	preorder, .-preorder
	.globl	delete
	.type	delete, @function
delete:
.LFB11:
	.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), %rdx
	movq	NIL(%rip), %rax
	cmpq	%rax, %rdx
	je	.L34
	movq	-24(%rbp), %rax
	movq	(%rax), %rdx
	movq	NIL(%rip), %rax
	cmpq	%rax, %rdx
	jne	.L35
.L34:
	movq	-24(%rbp), %rax
	movq	%rax, -16(%rbp)
	jmp	.L36
.L35:
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	successor
	movq	%rax, -16(%rbp)
.L36:
	movq	-16(%rbp), %rax
	movq	8(%rax), %rdx
	movq	NIL(%rip), %rax
	cmpq	%rax, %rdx
	je	.L37
	movq	-16(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -8(%rbp)
	jmp	.L38
.L37:
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
.L38:
	movq	NIL(%rip), %rax
	cmpq	%rax, -8(%rbp)
	je	.L39
	movq	-16(%rbp), %rax
	movq	16(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 16(%rax)
.L39:
	movq	-16(%rbp), %rax
	movq	16(%rax), %rdx
	movq	NIL(%rip), %rax
	cmpq	%rax, %rdx
	jne	.L40
	movq	-8(%rbp), %rax
	movq	%rax, root(%rip)
	jmp	.L41
.L40:
	movq	-16(%rbp), %rax
	movq	16(%rax), %rax
	movq	8(%rax), %rax
	cmpq	%rax, -16(%rbp)
	jne	.L42
	movq	-16(%rbp), %rax
	movq	16(%rax), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, 8(%rax)
	jmp	.L41
.L42:
	movq	-16(%rbp), %rax
	movq	16(%rax), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, (%rax)
.L41:
	movq	-16(%rbp), %rax
	cmpq	-24(%rbp), %rax
	je	.L43
	movq	-16(%rbp), %rax
	movl	24(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, 24(%rax)
.L43:
	movq	-16(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	delete, .-delete
	.globl	successor
	.type	successor, @function
successor:
.LFB12:
	.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	(%rax), %rdx
	movq	NIL(%rip), %rax
	cmpq	%rax, %rdx
	je	.L45
	movq	-24(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, %rdi
	call	min
	jmp	.L46
.L45:
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, -8(%rbp)
	jmp	.L47
.L49:
	movq	-8(%rbp), %rax
	movq	%rax, -24(%rbp)
	movq	-8(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, -8(%rbp)
.L47:
	movq	NIL(%rip), %rax
	cmpq	%rax, -8(%rbp)
	je	.L48
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, -24(%rbp)
	je	.L49
.L48:
	movq	-8(%rbp), %rax
.L46:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	successor, .-successor
	.globl	min
	.type	min, @function
min:
.LFB13:
	.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	.L51
.L52:
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -8(%rbp)
.L51:
	movq	-8(%rbp), %rax
	movq	8(%rax), %rdx
	movq	NIL(%rip), %rax
	cmpq	%rax, %rdx
	jne	.L52
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	min, .-min
	.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
	.globl	NIL
	.align 8
	.type	NIL, @object
	.size	NIL, 8
NIL:
	.zero	8
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"yes"
.LC3:
	.string	"no"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$144, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movb	$121, -134(%rbp)
	movb	$110, -133(%rbp)
	leaq	-132(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -124(%rbp)
	jmp	.L2
.L8:
	leaq	-112(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzbl	-112(%rbp), %eax
	cmpb	$102, %al
	jne	.L3
	leaq	-128(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	root(%rip), %rdx
	movl	-128(%rbp), %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	find
	movq	%rax, -120(%rbp)
	movq	NIL(%rip), %rax
	cmpq	%rax, -120(%rbp)
	je	.L4
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L5
.L4:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L5
.L3:
	movzbl	-112(%rbp), %eax
	cmpb	$105, %al
	jne	.L6
	leaq	-128(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-128(%rbp), %eax
	movl	%eax, %edi
	call	insert
	jmp	.L5
.L6:
	movzbl	-112(%rbp), %eax
	cmpb	$112, %al
	jne	.L7
	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	.L5
.L7:
	movzbl	-112(%rbp), %eax
	cmpb	$100, %al
	jne	.L5
	leaq	-128(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	root(%rip), %rdx
	movl	-128(%rbp), %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	find
	movq	%rax, %rdi
	call	delete
.L5:
	addl	$1, -124(%rbp)
.L2:
	movl	-132(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L8
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	insert
	.type	insert, @function
insert:
.LFB7:
	.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	NIL(%rip), %rax
	movq	%rax, -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	NIL(%rip), %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 8(%rax)
	movq	NIL(%rip), %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, (%rax)
	jmp	.L12
.L14:
	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	.L13
	movq	-16(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -16(%rbp)
	jmp	.L12
.L13:
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
.L12:
	movq	NIL(%rip), %rax
	cmpq	%rax, -16(%rbp)
	jne	.L14
	movq	-8(%rbp), %rax
	movq	-24(%rbp), %rdx
	movq	%rdx, 16(%rax)
	movq	NIL(%rip), %rax
	cmpq	%rax, -24(%rbp)
	jne	.L15
	movq	-8(%rbp), %rax
	movq	%rax, root(%rip)
	jmp	.L18
.L15:
	movq	-8(%rbp), %rax
	movl	24(%rax), %edx
	movq	-24(%rbp), %rax
	movl	24(%rax), %eax
	cmpl	%eax, %edx
	jge	.L17
	movq	-24(%rbp), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, 8(%rax)
	jmp	.L18
.L17:
	movq	-24(%rbp), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, (%rax)
.L18:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	insert, .-insert
	.globl	find
	.type	find, @function
find:
.LFB8:
	.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)
	movq	%rsi, -16(%rbp)
	jmp	.L20
.L23:
	movq	-16(%rbp), %rax
	movl	24(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jge	.L21
	movq	-16(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -16(%rbp)
	jmp	.L20
.L21:
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
.L20:
	movq	NIL(%rip), %rax
	cmpq	%rax, -16(%rbp)
	je	.L22
	movq	-16(%rbp), %rax
	movl	24(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jne	.L23
.L22:
	movq	-16(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	find, .-find
	.section	.rodata
.LC4:
	.string	" %d"
	.text
	.globl	inorder
	.type	inorder, @function
inorder:
.LFB9:
	.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)
	movq	NIL(%rip), %rax
	cmpq	%rax, -8(%rbp)
	je	.L28
	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	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, %rdi
	call	inorder
	jmp	.L25
.L28:
	nop
.L25:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	inorder, .-inorder
	.globl	preorder
	.type	preorder, @function
preorder:
.LFB10:
	.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)
	movq	NIL(%rip), %rax
	cmpq	%rax, -8(%rbp)
	je	.L32
	movq	-8(%rbp), %rax
	movl	24(%rax), %eax
	movl	%eax, %esi
	leaq	.LC4(%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	.L29
.L32:
	nop
.L29:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	preorder, .-preorder
	.globl	delete
	.type	delete, @function
delete:
.LFB11:
	.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), %rdx
	movq	NIL(%rip), %rax
	cmpq	%rax, %rdx
	je	.L34
	movq	-24(%rbp), %rax
	movq	(%rax), %rdx
	movq	NIL(%rip), %rax
	cmpq	%rax, %rdx
	jne	.L35
.L34:
	movq	-24(%rbp), %rax
	movq	%rax, -16(%rbp)
	jmp	.L36
.L35:
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	successor
	movq	%rax, -16(%rbp)
.L36:
	movq	-16(%rbp), %rax
	movq	8(%rax), %rdx
	movq	NIL(%rip), %rax
	cmpq	%rax, %rdx
	je	.L37
	movq	-16(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -8(%rbp)
	jmp	.L38
.L37:
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
.L38:
	movq	NIL(%rip), %rax
	cmpq	%rax, -8(%rbp)
	je	.L39
	movq	-16(%rbp), %rax
	movq	16(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 16(%rax)
.L39:
	movq	-16(%rbp), %rax
	movq	16(%rax), %rdx
	movq	NIL(%rip), %rax
	cmpq	%rax, %rdx
	jne	.L40
	movq	-8(%rbp), %rax
	movq	%rax, root(%rip)
	jmp	.L41
.L40:
	movq	-16(%rbp), %rax
	movq	16(%rax), %rax
	movq	8(%rax), %rax
	cmpq	%rax, -16(%rbp)
	jne	.L42
	movq	-16(%rbp), %rax
	movq	16(%rax), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, 8(%rax)
	jmp	.L41
.L42:
	movq	-16(%rbp), %rax
	movq	16(%rax), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, (%rax)
.L41:
	movq	-16(%rbp), %rax
	cmpq	-24(%rbp), %rax
	je	.L43
	movq	-16(%rbp), %rax
	movl	24(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, 24(%rax)
.L43:
	movq	-16(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	delete, .-delete
	.globl	successor
	.type	successor, @function
successor:
.LFB12:
	.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	(%rax), %rdx
	movq	NIL(%rip), %rax
	cmpq	%rax, %rdx
	je	.L45
	movq	-24(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, %rdi
	call	min
	jmp	.L46
.L45:
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, -8(%rbp)
	jmp	.L47
.L49:
	movq	-8(%rbp), %rax
	movq	%rax, -24(%rbp)
	movq	-8(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, -8(%rbp)
.L47:
	movq	NIL(%rip), %rax
	cmpq	%rax, -8(%rbp)
	je	.L48
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, -24(%rbp)
	je	.L49
.L48:
	movq	-8(%rbp), %rax
.L46:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	successor, .-successor
	.globl	min
	.type	min, @function
min:
.LFB13:
	.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	.L51
.L52:
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -8(%rbp)
.L51:
	movq	-8(%rbp), %rax
	movq	8(%rax), %rdx
	movq	NIL(%rip), %rax
	cmpq	%rax, %rdx
	jne	.L52
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	min, .-min
	.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:
