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

```c
//Binary Search Tree 1
#include <stdio.h>
#include <stdlib.h>
struct node{
  int key;
  struct node *left,*right,*parent;
};
typedef struct node Node;
Node *rootnode;
Node *NIL;
void Insert(int );
void Preorder(Node *);
void Inorder(Node *);



int main(void){
  int n,i,key;
  char command[6];
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%s",command);
    if(command[0]=='i'){
      scanf("%d",&key);
      Insert(key);
    }
    else if(command[0]=='p'){
      Inorder(rootnode);
      printf("\n");
      Preorder(rootnode);
      printf("\n");
    }
  }

  return 0;
}
void Insert(int key){
  Node *parent=rootnode;
  Node *z;
  Node *y=NIL;
  z=(Node *)malloc(sizeof(Node));
  z->key=key;
  z->left=NIL;
  z->right=NIL;

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

void Preorder(Node *node){
  printf(" %d",node->key);
  if(node->left!=NIL)
    Preorder(node->left);
  if(node->right!=NIL)
    Preorder(node->right);
}

void Inorder(Node *node){
  if(node->left!=NIL)
    Inorder(node->left);
  printf(" %d",node->key);
  if(node->right!=NIL)
    Inorder(node->right);
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	rootnode
	.bss
	.align 8
	.type	rootnode, @object
	.size	rootnode, 8
rootnode:
	.zero	8
	.globl	NIL
	.align 8
	.type	NIL, @object
	.size	NIL, 8
NIL:
	.zero	8
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
	.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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -20(%rbp)
	jmp	.L2
.L5:
	leaq	-14(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzbl	-14(%rbp), %eax
	cmpb	$105, %al
	jne	.L3
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	call	Insert
	jmp	.L4
.L3:
	movzbl	-14(%rbp), %eax
	cmpb	$112, %al
	jne	.L4
	movq	rootnode(%rip), %rax
	movq	%rax, %rdi
	call	Inorder
	movl	$10, %edi
	call	putchar@PLT
	movq	rootnode(%rip), %rax
	movq	%rax, %rdi
	call	Preorder
	movl	$10, %edi
	call	putchar@PLT
.L4:
	addl	$1, -20(%rbp)
.L2:
	movl	-28(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L5
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	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	rootnode(%rip), %rax
	movq	%rax, -24(%rbp)
	movq	NIL(%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, (%rax)
	movq	NIL(%rip), %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 8(%rax)
	movq	NIL(%rip), %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 16(%rax)
	jmp	.L9
.L11:
	movq	-24(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -36(%rbp)
	jle	.L10
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, -24(%rbp)
	jmp	.L9
.L10:
	movq	-24(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -24(%rbp)
.L9:
	movq	NIL(%rip), %rax
	cmpq	%rax, -24(%rbp)
	jne	.L11
	movq	NIL(%rip), %rax
	cmpq	%rax, -16(%rbp)
	jne	.L12
	movq	-8(%rbp), %rax
	movq	%rax, rootnode(%rip)
.L12:
	movq	-8(%rbp), %rax
	movq	-16(%rbp), %rdx
	movq	%rdx, 24(%rax)
	movq	NIL(%rip), %rax
	cmpq	%rax, -16(%rbp)
	je	.L15
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -36(%rbp)
	jle	.L14
	movq	-16(%rbp), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, 16(%rax)
	jmp	.L15
.L14:
	movq	-16(%rbp), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, 8(%rax)
.L15:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	Insert, .-Insert
	.section	.rodata
.LC2:
	.string	" %d"
	.text
	.globl	Preorder
	.type	Preorder, @function
Preorder:
.LFB8:
	.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	-8(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	-8(%rbp), %rax
	movq	8(%rax), %rdx
	movq	NIL(%rip), %rax
	cmpq	%rax, %rdx
	je	.L17
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, %rdi
	call	Preorder
.L17:
	movq	-8(%rbp), %rax
	movq	16(%rax), %rdx
	movq	NIL(%rip), %rax
	cmpq	%rax, %rdx
	je	.L19
	movq	-8(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, %rdi
	call	Preorder
.L19:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	Preorder, .-Preorder
	.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	-8(%rbp), %rax
	movq	8(%rax), %rdx
	movq	NIL(%rip), %rax
	cmpq	%rax, %rdx
	je	.L21
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, %rdi
	call	Inorder
.L21:
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	-8(%rbp), %rax
	movq	16(%rax), %rdx
	movq	NIL(%rip), %rax
	cmpq	%rax, %rdx
	je	.L23
	movq	-8(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, %rdi
	call	Inorder
.L23:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	Inorder, .-Inorder
	.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
	movq	NIL(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movl	%edi, %ebp
	movl	$32, %edi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	rootnode(%rip), %rbx
	call	malloc@PLT
	movq	%r12, %xmm0
	punpcklqdq	%xmm0, %xmm0
	movl	%ebp, (%rax)
	movups	%xmm0, 8(%rax)
	cmpq	%r12, %rbx
	je	.L2
	.p2align 4,,10
	.p2align 3
.L7:
	movq	8(%rbx), %rcx
	movq	16(%rbx), %rdx
	cmpl	(%rbx), %ebp
	jle	.L3
.L19:
	cmpq	%r12, %rdx
	je	.L18
	movq	%rdx, %rbx
	movq	8(%rbx), %rcx
	movq	16(%rbx), %rdx
	cmpl	(%rbx), %ebp
	jg	.L19
.L3:
	cmpq	%r12, %rcx
	je	.L6
	movq	%rcx, %rbx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L18:
	cmpq	%rbx, %r12
	je	.L2
	movq	%rbx, 24(%rax)
	movq	%rax, 16(%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
	cmpq	%rbx, %r12
	je	.L2
	movq	%rbx, 24(%rax)
	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
.L2:
	.cfi_restore_state
	movq	%rbx, 24(%rax)
	popq	%rbx
	.cfi_def_cfa_offset 24
	movq	%rax, rootnode(%rip)
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE40:
	.size	Insert, .-Insert
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	" %d"
	.text
	.p2align 4
	.globl	Preorder
	.type	Preorder, @function
Preorder:
.LFB41:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%rdi, 24(%rsp)
.L39:
	movq	24(%rsp), %rbx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	(%rbx), %edx
	call	__printf_chk@PLT
	movq	8(%rbx), %rax
	movq	NIL(%rip), %r15
	movq	%rax, 16(%rsp)
	cmpq	%r15, %rax
	je	.L21
.L38:
	movq	16(%rsp), %rbx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	(%rbx), %edx
	call	__printf_chk@PLT
	movq	8(%rbx), %rax
	movq	NIL(%rip), %r15
	movq	%rax, 8(%rsp)
	cmpq	%r15, %rax
	je	.L22
.L37:
	movq	8(%rsp), %rbx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	(%rbx), %edx
	call	__printf_chk@PLT
	movq	8(%rbx), %rax
	movq	NIL(%rip), %r15
	movq	%rax, (%rsp)
	cmpq	%r15, %rax
	je	.L23
.L36:
	movq	(%rsp), %rbx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	(%rbx), %edx
	call	__printf_chk@PLT
	movq	8(%rbx), %r12
	movq	NIL(%rip), %r15
	cmpq	%r15, %r12
	je	.L24
.L35:
	movl	(%r12), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%r12), %rbx
	movq	NIL(%rip), %r15
	cmpq	%r15, %rbx
	je	.L25
.L34:
	movl	(%rbx), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%rbx), %r14
	movq	NIL(%rip), %r15
	cmpq	%r15, %r14
	je	.L26
.L33:
	movl	(%r14), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%r14), %r13
	movq	NIL(%rip), %r15
	cmpq	%r15, %r13
	je	.L27
.L32:
	movl	0(%r13), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%r13), %rax
	movq	NIL(%rip), %r15
	cmpq	%r15, %rax
	je	.L28
	movq	%rax, %r15
.L31:
	movl	(%r15), %edx
	movl	$1, %edi
	xorl	%eax, %eax
	movq	%rbp, %rsi
	call	__printf_chk@PLT
	movq	8(%r15), %rdi
	cmpq	NIL(%rip), %rdi
	je	.L29
	call	Preorder
	movq	16(%r15), %r15
	cmpq	%r15, NIL(%rip)
	jne	.L31
	.p2align 4,,10
	.p2align 3
.L28:
	movq	16(%r13), %r13
	cmpq	%r15, %r13
	jne	.L32
.L27:
	movq	16(%r14), %r14
	cmpq	%r15, %r14
	jne	.L33
.L26:
	movq	16(%rbx), %rbx
	cmpq	%r15, %rbx
	jne	.L34
.L25:
	movq	16(%r12), %r12
	cmpq	%r15, %r12
	jne	.L35
.L24:
	movq	(%rsp), %rax
	movq	16(%rax), %rax
	movq	%rax, (%rsp)
	cmpq	%r15, %rax
	jne	.L36
.L23:
	movq	8(%rsp), %rax
	movq	16(%rax), %rax
	movq	%rax, 8(%rsp)
	cmpq	%r15, %rax
	jne	.L37
.L22:
	movq	16(%rsp), %rax
	movq	16(%rax), %rax
	movq	%rax, 16(%rsp)
	cmpq	%r15, %rax
	jne	.L38
.L21:
	movq	24(%rsp), %rax
	movq	16(%rax), %rax
	movq	%rax, 24(%rsp)
	cmpq	%r15, %rax
	jne	.L39
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L29:
	.cfi_restore_state
	movq	16(%r15), %r15
	cmpq	%r15, %rdi
	jne	.L31
	movq	16(%r13), %r13
	cmpq	%r15, %r13
	jne	.L32
	jmp	.L27
	.cfi_endproc
.LFE41:
	.size	Preorder, .-Preorder
	.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
	leaq	.LC0(%rip), %rbp
	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, 24(%rsp)
.L51:
	movq	24(%rsp), %rcx
	movq	8(%rcx), %rcx
	movq	%rcx, 16(%rsp)
	cmpq	%rax, %rcx
	je	.L54
.L50:
	movq	16(%rsp), %rcx
	movq	8(%rcx), %rcx
	movq	%rcx, 8(%rsp)
	cmpq	%rax, %rcx
	je	.L56
.L53:
	movq	8(%rsp), %rcx
	movq	8(%rcx), %rcx
	movq	%rcx, (%rsp)
	cmpq	%rax, %rcx
	je	.L58
.L55:
	movq	(%rsp), %rcx
	movq	8(%rcx), %r12
	cmpq	%rax, %r12
	je	.L60
.L57:
	movq	8(%r12), %rbx
	cmpq	%rax, %rbx
	je	.L62
.L59:
	movq	8(%rbx), %r15
	cmpq	%rax, %r15
	je	.L64
.L61:
	movq	8(%r15), %r14
	cmpq	%rax, %r14
	je	.L66
.L63:
	movq	8(%r14), %r13
	cmpq	%rax, %r13
	je	.L69
.L65:
	movq	8(%r13), %rdi
	cmpq	%rax, %rdi
	je	.L67
	call	Inorder
	movl	0(%r13), %edx
	movq	%rbp, %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	16(%r13), %r13
	movq	NIL(%rip), %rax
	cmpq	%r13, %rax
	jne	.L65
	.p2align 4,,10
	.p2align 3
.L69:
	movl	(%r14), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	16(%r14), %r14
	movq	NIL(%rip), %rax
	cmpq	%rax, %r14
	jne	.L63
.L66:
	movl	(%r15), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	16(%r15), %r15
	movq	NIL(%rip), %rax
	cmpq	%rax, %r15
	jne	.L61
.L64:
	movl	(%rbx), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	16(%rbx), %rbx
	movq	NIL(%rip), %rax
	cmpq	%rax, %rbx
	jne	.L59
.L62:
	movl	(%r12), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	16(%r12), %r12
	movq	NIL(%rip), %rax
	cmpq	%rax, %r12
	jne	.L57
.L60:
	movq	(%rsp), %rbx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	(%rbx), %edx
	call	__printf_chk@PLT
	movq	16(%rbx), %rcx
	movq	NIL(%rip), %rax
	movq	%rcx, (%rsp)
	cmpq	%rax, %rcx
	jne	.L55
.L58:
	movq	8(%rsp), %rbx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	(%rbx), %edx
	call	__printf_chk@PLT
	movq	16(%rbx), %rcx
	movq	NIL(%rip), %rax
	movq	%rcx, 8(%rsp)
	cmpq	%rax, %rcx
	jne	.L53
.L56:
	movq	16(%rsp), %rbx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	(%rbx), %edx
	call	__printf_chk@PLT
	movq	16(%rbx), %rcx
	movq	NIL(%rip), %rax
	movq	%rcx, 16(%rsp)
	cmpq	%rax, %rcx
	jne	.L50
.L54:
	movq	24(%rsp), %rbx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	(%rbx), %edx
	call	__printf_chk@PLT
	movq	16(%rbx), %rcx
	movq	NIL(%rip), %rax
	movq	%rcx, 24(%rsp)
	cmpq	%rax, %rcx
	jne	.L51
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L67:
	.cfi_restore_state
	movl	0(%r13), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	16(%r13), %r13
	movq	NIL(%rip), %rax
	cmpq	%rax, %r13
	jne	.L65
	jmp	.L69
	.cfi_endproc
.LFE42:
	.size	Inorder, .-Inorder
	.section	.rodata.str1.1
.LC1:
	.string	"%d"
.LC2:
	.string	"%s"
	.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	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	testl	%eax, %eax
	jle	.L98
	xorl	%r15d, %r15d
	leaq	34(%rsp), %r12
	leaq	28(%rsp), %r14
	leaq	.LC2(%rip), %rbp
	jmp	.L89
	.p2align 4,,10
	.p2align 3
.L90:
	cmpb	$112, %al
	je	.L113
.L97:
	addl	$1, %r15d
	cmpl	%r15d, 24(%rsp)
	jle	.L98
.L89:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movzbl	34(%rsp), %eax
	cmpb	$105, %al
	jne	.L90
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r8d
	movq	NIL(%rip), %rsi
	movl	$32, %edi
	movq	rootnode(%rip), %rbx
	movl	%r8d, 12(%rsp)
	movq	%rsi, (%rsp)
	call	malloc@PLT
	movq	(%rsp), %rsi
	movl	12(%rsp), %r8d
	movq	%rsi, %xmm0
	movl	%r8d, (%rax)
	punpcklqdq	%xmm0, %xmm0
	movups	%xmm0, 8(%rax)
	cmpq	%rsi, %rbx
	je	.L91
	.p2align 4,,10
	.p2align 3
.L96:
	movq	8(%rbx), %rcx
	movq	16(%rbx), %rdx
	cmpl	(%rbx), %r8d
	jle	.L92
.L115:
	cmpq	%rdx, %rsi
	je	.L114
	movq	%rdx, %rbx
	movq	8(%rbx), %rcx
	movq	16(%rbx), %rdx
	cmpl	(%rbx), %r8d
	jg	.L115
.L92:
	cmpq	%rcx, %rsi
	je	.L95
	movq	%rcx, %rbx
	jmp	.L96
	.p2align 4,,10
	.p2align 3
.L113:
	movq	rootnode(%rip), %rdi
	addl	$1, %r15d
	call	Inorder
	movl	$10, %edi
	call	putchar@PLT
	movq	rootnode(%rip), %rdi
	call	Preorder
	movl	$10, %edi
	call	putchar@PLT
	cmpl	%r15d, 24(%rsp)
	jg	.L89
	.p2align 4,,10
	.p2align 3
.L98:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L116
	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
.L114:
	.cfi_restore_state
	cmpq	%rbx, %rsi
	je	.L91
	movq	%rbx, 24(%rax)
	movq	%rax, 16(%rbx)
	jmp	.L97
	.p2align 4,,10
	.p2align 3
.L95:
	cmpq	%rbx, %rsi
	je	.L91
	movq	%rbx, 24(%rax)
	movq	%rax, 8(%rbx)
	jmp	.L97
.L91:
	movq	%rax, rootnode(%rip)
	movq	%rbx, 24(%rax)
	jmp	.L97
.L116:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.globl	NIL
	.bss
	.align 8
	.type	NIL, @object
	.size	NIL, 8
NIL:
	.zero	8
	.globl	rootnode
	.align 8
	.type	rootnode, @object
	.size	rootnode, 8
rootnode:
	.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
	movq	NIL(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movl	%edi, %ebp
	movl	$32, %edi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	rootnode(%rip), %rbx
	call	malloc@PLT
	movq	%r12, %xmm0
	punpcklqdq	%xmm0, %xmm0
	movl	%ebp, (%rax)
	movups	%xmm0, 8(%rax)
	cmpq	%r12, %rbx
	je	.L2
	.p2align 4,,10
	.p2align 3
.L7:
	movq	8(%rbx), %rcx
	movq	16(%rbx), %rdx
	cmpl	(%rbx), %ebp
	jle	.L3
.L19:
	cmpq	%r12, %rdx
	je	.L18
	movq	%rdx, %rbx
	movq	8(%rbx), %rcx
	movq	16(%rbx), %rdx
	cmpl	(%rbx), %ebp
	jg	.L19
.L3:
	cmpq	%r12, %rcx
	je	.L6
	movq	%rcx, %rbx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L18:
	cmpq	%rbx, %r12
	je	.L2
	movq	%rbx, 24(%rax)
	movq	%rax, 16(%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
	cmpq	%rbx, %r12
	je	.L2
	movq	%rbx, 24(%rax)
	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
.L2:
	.cfi_restore_state
	movq	%rbx, 24(%rax)
	popq	%rbx
	.cfi_def_cfa_offset 24
	movq	%rax, rootnode(%rip)
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE40:
	.size	Insert, .-Insert
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	" %d"
	.text
	.p2align 4
	.globl	Preorder
	.type	Preorder, @function
Preorder:
.LFB41:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%rdi, 24(%rsp)
.L39:
	movq	24(%rsp), %rbx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	(%rbx), %edx
	call	__printf_chk@PLT
	movq	8(%rbx), %rax
	movq	NIL(%rip), %r15
	movq	%rax, 16(%rsp)
	cmpq	%r15, %rax
	je	.L21
.L38:
	movq	16(%rsp), %rbx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	(%rbx), %edx
	call	__printf_chk@PLT
	movq	8(%rbx), %rax
	movq	NIL(%rip), %r15
	movq	%rax, 8(%rsp)
	cmpq	%r15, %rax
	je	.L22
.L37:
	movq	8(%rsp), %rbx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	(%rbx), %edx
	call	__printf_chk@PLT
	movq	8(%rbx), %rax
	movq	NIL(%rip), %r15
	movq	%rax, (%rsp)
	cmpq	%r15, %rax
	je	.L23
.L36:
	movq	(%rsp), %rbx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	(%rbx), %edx
	call	__printf_chk@PLT
	movq	8(%rbx), %r12
	movq	NIL(%rip), %r15
	cmpq	%r15, %r12
	je	.L24
.L35:
	movl	(%r12), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%r12), %rbx
	movq	NIL(%rip), %r15
	cmpq	%r15, %rbx
	je	.L25
.L34:
	movl	(%rbx), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%rbx), %r14
	movq	NIL(%rip), %r15
	cmpq	%r15, %r14
	je	.L26
.L33:
	movl	(%r14), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%r14), %r13
	movq	NIL(%rip), %r15
	cmpq	%r15, %r13
	je	.L27
.L32:
	movl	0(%r13), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%r13), %rax
	movq	NIL(%rip), %r15
	cmpq	%r15, %rax
	je	.L28
	movq	%rax, %r15
.L31:
	movl	(%r15), %edx
	movl	$1, %edi
	xorl	%eax, %eax
	movq	%rbp, %rsi
	call	__printf_chk@PLT
	movq	8(%r15), %rdi
	cmpq	NIL(%rip), %rdi
	je	.L29
	call	Preorder
	movq	16(%r15), %r15
	cmpq	%r15, NIL(%rip)
	jne	.L31
	.p2align 4,,10
	.p2align 3
.L28:
	movq	16(%r13), %r13
	cmpq	%r15, %r13
	jne	.L32
.L27:
	movq	16(%r14), %r14
	cmpq	%r15, %r14
	jne	.L33
.L26:
	movq	16(%rbx), %rbx
	cmpq	%r15, %rbx
	jne	.L34
.L25:
	movq	16(%r12), %r12
	cmpq	%r15, %r12
	jne	.L35
.L24:
	movq	(%rsp), %rax
	movq	16(%rax), %rax
	movq	%rax, (%rsp)
	cmpq	%r15, %rax
	jne	.L36
.L23:
	movq	8(%rsp), %rax
	movq	16(%rax), %rax
	movq	%rax, 8(%rsp)
	cmpq	%r15, %rax
	jne	.L37
.L22:
	movq	16(%rsp), %rax
	movq	16(%rax), %rax
	movq	%rax, 16(%rsp)
	cmpq	%r15, %rax
	jne	.L38
.L21:
	movq	24(%rsp), %rax
	movq	16(%rax), %rax
	movq	%rax, 24(%rsp)
	cmpq	%r15, %rax
	jne	.L39
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L29:
	.cfi_restore_state
	movq	16(%r15), %r15
	cmpq	%r15, %rdi
	jne	.L31
	movq	16(%r13), %r13
	cmpq	%r15, %r13
	jne	.L32
	jmp	.L27
	.cfi_endproc
.LFE41:
	.size	Preorder, .-Preorder
	.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
	leaq	.LC0(%rip), %rbp
	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, 24(%rsp)
.L51:
	movq	24(%rsp), %rcx
	movq	8(%rcx), %rcx
	movq	%rcx, 16(%rsp)
	cmpq	%rax, %rcx
	je	.L54
.L50:
	movq	16(%rsp), %rcx
	movq	8(%rcx), %rcx
	movq	%rcx, 8(%rsp)
	cmpq	%rax, %rcx
	je	.L56
.L53:
	movq	8(%rsp), %rcx
	movq	8(%rcx), %rcx
	movq	%rcx, (%rsp)
	cmpq	%rax, %rcx
	je	.L58
.L55:
	movq	(%rsp), %rcx
	movq	8(%rcx), %r12
	cmpq	%rax, %r12
	je	.L60
.L57:
	movq	8(%r12), %rbx
	cmpq	%rax, %rbx
	je	.L62
.L59:
	movq	8(%rbx), %r15
	cmpq	%rax, %r15
	je	.L64
.L61:
	movq	8(%r15), %r14
	cmpq	%rax, %r14
	je	.L66
.L63:
	movq	8(%r14), %r13
	cmpq	%rax, %r13
	je	.L69
.L65:
	movq	8(%r13), %rdi
	cmpq	%rax, %rdi
	je	.L67
	call	Inorder
	movl	0(%r13), %edx
	movq	%rbp, %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	16(%r13), %r13
	movq	NIL(%rip), %rax
	cmpq	%r13, %rax
	jne	.L65
	.p2align 4,,10
	.p2align 3
.L69:
	movl	(%r14), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	16(%r14), %r14
	movq	NIL(%rip), %rax
	cmpq	%rax, %r14
	jne	.L63
.L66:
	movl	(%r15), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	16(%r15), %r15
	movq	NIL(%rip), %rax
	cmpq	%rax, %r15
	jne	.L61
.L64:
	movl	(%rbx), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	16(%rbx), %rbx
	movq	NIL(%rip), %rax
	cmpq	%rax, %rbx
	jne	.L59
.L62:
	movl	(%r12), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	16(%r12), %r12
	movq	NIL(%rip), %rax
	cmpq	%rax, %r12
	jne	.L57
.L60:
	movq	(%rsp), %rbx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	(%rbx), %edx
	call	__printf_chk@PLT
	movq	16(%rbx), %rcx
	movq	NIL(%rip), %rax
	movq	%rcx, (%rsp)
	cmpq	%rax, %rcx
	jne	.L55
.L58:
	movq	8(%rsp), %rbx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	(%rbx), %edx
	call	__printf_chk@PLT
	movq	16(%rbx), %rcx
	movq	NIL(%rip), %rax
	movq	%rcx, 8(%rsp)
	cmpq	%rax, %rcx
	jne	.L53
.L56:
	movq	16(%rsp), %rbx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	(%rbx), %edx
	call	__printf_chk@PLT
	movq	16(%rbx), %rcx
	movq	NIL(%rip), %rax
	movq	%rcx, 16(%rsp)
	cmpq	%rax, %rcx
	jne	.L50
.L54:
	movq	24(%rsp), %rbx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	(%rbx), %edx
	call	__printf_chk@PLT
	movq	16(%rbx), %rcx
	movq	NIL(%rip), %rax
	movq	%rcx, 24(%rsp)
	cmpq	%rax, %rcx
	jne	.L51
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L67:
	.cfi_restore_state
	movl	0(%r13), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	16(%r13), %r13
	movq	NIL(%rip), %rax
	cmpq	%rax, %r13
	jne	.L65
	jmp	.L69
	.cfi_endproc
.LFE42:
	.size	Inorder, .-Inorder
	.section	.rodata.str1.1
.LC1:
	.string	"%d"
.LC2:
	.string	"%s"
	.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	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	testl	%eax, %eax
	jle	.L98
	xorl	%r15d, %r15d
	leaq	34(%rsp), %r12
	leaq	28(%rsp), %r14
	leaq	.LC2(%rip), %rbp
	jmp	.L89
	.p2align 4,,10
	.p2align 3
.L90:
	cmpb	$112, %al
	je	.L113
.L97:
	addl	$1, %r15d
	cmpl	%r15d, 24(%rsp)
	jle	.L98
.L89:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movzbl	34(%rsp), %eax
	cmpb	$105, %al
	jne	.L90
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r8d
	movq	NIL(%rip), %rsi
	movl	$32, %edi
	movq	rootnode(%rip), %rbx
	movl	%r8d, 12(%rsp)
	movq	%rsi, (%rsp)
	call	malloc@PLT
	movq	(%rsp), %rsi
	movl	12(%rsp), %r8d
	movq	%rsi, %xmm0
	movl	%r8d, (%rax)
	punpcklqdq	%xmm0, %xmm0
	movups	%xmm0, 8(%rax)
	cmpq	%rsi, %rbx
	je	.L91
	.p2align 4,,10
	.p2align 3
.L96:
	movq	8(%rbx), %rcx
	movq	16(%rbx), %rdx
	cmpl	(%rbx), %r8d
	jle	.L92
.L115:
	cmpq	%rdx, %rsi
	je	.L114
	movq	%rdx, %rbx
	movq	8(%rbx), %rcx
	movq	16(%rbx), %rdx
	cmpl	(%rbx), %r8d
	jg	.L115
.L92:
	cmpq	%rcx, %rsi
	je	.L95
	movq	%rcx, %rbx
	jmp	.L96
	.p2align 4,,10
	.p2align 3
.L113:
	movq	rootnode(%rip), %rdi
	addl	$1, %r15d
	call	Inorder
	movl	$10, %edi
	call	putchar@PLT
	movq	rootnode(%rip), %rdi
	call	Preorder
	movl	$10, %edi
	call	putchar@PLT
	cmpl	%r15d, 24(%rsp)
	jg	.L89
	.p2align 4,,10
	.p2align 3
.L98:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L116
	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
.L114:
	.cfi_restore_state
	cmpq	%rbx, %rsi
	je	.L91
	movq	%rbx, 24(%rax)
	movq	%rax, 16(%rbx)
	jmp	.L97
	.p2align 4,,10
	.p2align 3
.L95:
	cmpq	%rbx, %rsi
	je	.L91
	movq	%rbx, 24(%rax)
	movq	%rax, 8(%rbx)
	jmp	.L97
.L91:
	movq	%rax, rootnode(%rip)
	movq	%rbx, 24(%rax)
	jmp	.L97
.L116:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.globl	NIL
	.bss
	.align 8
	.type	NIL, @object
	.size	NIL, 8
NIL:
	.zero	8
	.globl	rootnode
	.align 8
	.type	rootnode, @object
	.size	rootnode, 8
rootnode:
	.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:

//Binary Search Tree 1
#include <stdio.h>
#include <stdlib.h>
struct node{
  int key;
  struct node *left,*right,*parent;
};
typedef struct node Node;
Node *rootnode;
Node *NIL;
void Insert(int );
void Preorder(Node *);
void Inorder(Node *);



int main(void){
  int n,i,key;
  char command[6];
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%s",command);
    if(command[0]=='i'){
      scanf("%d",&key);
      Insert(key);
    }
    else if(command[0]=='p'){
      Inorder(rootnode);
      printf("\n");
      Preorder(rootnode);
      printf("\n");
    }
  }

  return 0;
}
void Insert(int key){
  Node *parent=rootnode;
  Node *z;
  Node *y=NIL;
  z=(Node *)malloc(sizeof(Node));
  z->key=key;
  z->left=NIL;
  z->right=NIL;

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

void Preorder(Node *node){
  printf(" %d",node->key);
  if(node->left!=NIL)
    Preorder(node->left);
  if(node->right!=NIL)
    Preorder(node->right);
}

void Inorder(Node *node){
  if(node->left!=NIL)
    Inorder(node->left);
  printf(" %d",node->key);
  if(node->right!=NIL)
    Inorder(node->right);
}


8
insert 30
insert 88
insert 18
insert 1
insert 20
insert 17
insert 25
print
 8
insert 30
insert 113
insert 18
insert 1
insert 20
insert 17
insert 25
print
 8
insert 30
insert 88
insert 18
insert 1
insert 20
insert 21
insert 25
print
 8
insert 30
insert 88
insert 24
insert 1
insert 20
insert 21
insert 25
print
 8
insert 30
insert 88
insert 24
insert 1
insert 20
insert 21
insert 16
print
 8
insert 30
insert 99
insert 12
insert 1
insert 20
insert 17
insert 25
print
 8
insert 30
insert 88
insert 18
insert 0
insert 20
insert 21
insert 25
print
 8
insert 30
insert 99
insert 12
insert 1
insert 20
insert 17
insert 19
print
 8
insert 30
insert 88
insert 12
insert 1
insert 32
insert 17
insert 25
print
 8
insert 30
insert 93
insert 18
insert 1
insert 20
insert 17
insert 25
print

 1 17 18 20 25 30 88
 30 18 1 17 20 25 88
  1 17 18 20 25 30 113
 30 18 1 17 20 25 113
  1 18 20 21 25 30 88
 30 18 1 20 21 25 88
  1 20 21 24 25 30 88
 30 24 1 20 21 25 88
  1 16 20 21 24 30 88
 30 24 1 20 16 21 88
  1 12 17 20 25 30 99
 30 12 1 20 17 25 99
  0 18 20 21 25 30 88
 30 18 0 20 21 25 88
  1 12 17 19 20 30 99
 30 12 1 20 17 19 99
  1 12 17 25 30 32 88
 30 12 1 17 25 88 32
  1 17 18 20 25 30 93
 30 18 1 17 20 25 93

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

```c
//Binary Search Tree 1
#include <stdio.h>
#include <stdlib.h>
struct node{
  int key;
  struct node *left,*right,*parent;
};
typedef struct node Node;
Node *rootnode;
Node *NIL;
void Insert(int );
void Preorder(Node *);
void Inorder(Node *);



int main(void){
  int n,i,key;
  char command[6];
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%s",command);
    if(command[0]=='i'){
      scanf("%d",&key);
      Insert(key);
    }
    else if(command[0]=='p'){
      Inorder(rootnode);
      printf("\n");
      Preorder(rootnode);
      printf("\n");
    }
  }

  return 0;
}
void Insert(int key){
  Node *parent=rootnode;
  Node *z;
  Node *y=NIL;
  z=(Node *)malloc(sizeof(Node));
  z->key=key;
  z->left=NIL;
  z->right=NIL;

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

void Preorder(Node *node){
  printf(" %d",node->key);
  if(node->left!=NIL)
    Preorder(node->left);
  if(node->right!=NIL)
    Preorder(node->right);
}

void Inorder(Node *node){
  if(node->left!=NIL)
    Inorder(node->left);
  printf(" %d",node->key);
  if(node->right!=NIL)
    Inorder(node->right);
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	rootnode
	.bss
	.align 8
	.type	rootnode, @object
	.size	rootnode, 8
rootnode:
	.zero	8
	.globl	NIL
	.align 8
	.type	NIL, @object
	.size	NIL, 8
NIL:
	.zero	8
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
	.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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -20(%rbp)
	jmp	.L2
.L5:
	leaq	-14(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzbl	-14(%rbp), %eax
	cmpb	$105, %al
	jne	.L3
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	call	Insert
	jmp	.L4
.L3:
	movzbl	-14(%rbp), %eax
	cmpb	$112, %al
	jne	.L4
	movq	rootnode(%rip), %rax
	movq	%rax, %rdi
	call	Inorder
	movl	$10, %edi
	call	putchar@PLT
	movq	rootnode(%rip), %rax
	movq	%rax, %rdi
	call	Preorder
	movl	$10, %edi
	call	putchar@PLT
.L4:
	addl	$1, -20(%rbp)
.L2:
	movl	-28(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L5
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	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	rootnode(%rip), %rax
	movq	%rax, -24(%rbp)
	movq	NIL(%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, (%rax)
	movq	NIL(%rip), %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 8(%rax)
	movq	NIL(%rip), %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 16(%rax)
	jmp	.L9
.L11:
	movq	-24(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -36(%rbp)
	jle	.L10
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, -24(%rbp)
	jmp	.L9
.L10:
	movq	-24(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -24(%rbp)
.L9:
	movq	NIL(%rip), %rax
	cmpq	%rax, -24(%rbp)
	jne	.L11
	movq	NIL(%rip), %rax
	cmpq	%rax, -16(%rbp)
	jne	.L12
	movq	-8(%rbp), %rax
	movq	%rax, rootnode(%rip)
.L12:
	movq	-8(%rbp), %rax
	movq	-16(%rbp), %rdx
	movq	%rdx, 24(%rax)
	movq	NIL(%rip), %rax
	cmpq	%rax, -16(%rbp)
	je	.L15
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -36(%rbp)
	jle	.L14
	movq	-16(%rbp), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, 16(%rax)
	jmp	.L15
.L14:
	movq	-16(%rbp), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, 8(%rax)
.L15:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	Insert, .-Insert
	.section	.rodata
.LC2:
	.string	" %d"
	.text
	.globl	Preorder
	.type	Preorder, @function
Preorder:
.LFB8:
	.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	-8(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	-8(%rbp), %rax
	movq	8(%rax), %rdx
	movq	NIL(%rip), %rax
	cmpq	%rax, %rdx
	je	.L17
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, %rdi
	call	Preorder
.L17:
	movq	-8(%rbp), %rax
	movq	16(%rax), %rdx
	movq	NIL(%rip), %rax
	cmpq	%rax, %rdx
	je	.L19
	movq	-8(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, %rdi
	call	Preorder
.L19:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	Preorder, .-Preorder
	.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	-8(%rbp), %rax
	movq	8(%rax), %rdx
	movq	NIL(%rip), %rax
	cmpq	%rax, %rdx
	je	.L21
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, %rdi
	call	Inorder
.L21:
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	-8(%rbp), %rax
	movq	16(%rax), %rdx
	movq	NIL(%rip), %rax
	cmpq	%rax, %rdx
	je	.L23
	movq	-8(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, %rdi
	call	Inorder
.L23:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	Inorder, .-Inorder
	.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.
val
	.file	"temp.c"
	.text
	.globl	rootnode
	.bss
	.align 8
	.type	rootnode, @object
	.size	rootnode, 8
rootnode:
	.zero	8
	.globl	NIL
	.align 8
	.type	NIL, @object
	.size	NIL, 8
NIL:
	.zero	8
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
	.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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -20(%rbp)
	jmp	.L2
.L5:
	leaq	-14(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzbl	-14(%rbp), %eax
	cmpb	$105, %al
	jne	.L3
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	call	Insert
	jmp	.L4
.L3:
	movzbl	-14(%rbp), %eax
	cmpb	$112, %al
	jne	.L4
	movq	rootnode(%rip), %rax
	movq	%rax, %rdi
	call	Inorder
	movl	$10, %edi
	call	putchar@PLT
	movq	rootnode(%rip), %rax
	movq	%rax, %rdi
	call	Preorder
	movl	$10, %edi
	call	putchar@PLT
.L4:
	addl	$1, -20(%rbp)
.L2:
	movl	-28(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L5
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	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	rootnode(%rip), %rax
	movq	%rax, -24(%rbp)
	movq	NIL(%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, (%rax)
	movq	NIL(%rip), %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 8(%rax)
	movq	NIL(%rip), %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, 16(%rax)
	jmp	.L9
.L11:
	movq	-24(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -36(%rbp)
	jle	.L10
	movq	-24(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, -24(%rbp)
	jmp	.L9
.L10:
	movq	-24(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, -24(%rbp)
.L9:
	movq	NIL(%rip), %rax
	cmpq	%rax, -24(%rbp)
	jne	.L11
	movq	NIL(%rip), %rax
	cmpq	%rax, -16(%rbp)
	jne	.L12
	movq	-8(%rbp), %rax
	movq	%rax, rootnode(%rip)
.L12:
	movq	-8(%rbp), %rax
	movq	-16(%rbp), %rdx
	movq	%rdx, 24(%rax)
	movq	NIL(%rip), %rax
	cmpq	%rax, -16(%rbp)
	je	.L15
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -36(%rbp)
	jle	.L14
	movq	-16(%rbp), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, 16(%rax)
	jmp	.L15
.L14:
	movq	-16(%rbp), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, 8(%rax)
.L15:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	Insert, .-Insert
	.section	.rodata
.LC2:
	.string	" %d"
	.text
	.globl	Preorder
	.type	Preorder, @function
Preorder:
.LFB8:
	.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	-8(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	-8(%rbp), %rax
	movq	8(%rax), %rdx
	movq	NIL(%rip), %rax
	cmpq	%rax, %rdx
	je	.L17
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, %rdi
	call	Preorder
.L17:
	movq	-8(%rbp), %rax
	movq	16(%rax), %rdx
	movq	NIL(%rip), %rax
	cmpq	%rax, %rdx
	je	.L19
	movq	-8(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, %rdi
	call	Preorder
.L19:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	Preorder, .-Preorder
	.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	-8(%rbp), %rax
	movq	8(%rax), %rdx
	movq	NIL(%rip), %rax
	cmpq	%rax, %rdx
	je	.L21
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	movq	%rax, %rdi
	call	Inorder
.L21:
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	-8(%rbp), %rax
	movq	16(%rax), %rdx
	movq	NIL(%rip), %rax
	cmpq	%rax, %rdx
	je	.L23
	movq	-8(%rbp), %rax
	movq	16(%rax), %rax
	movq	%rax, %rdi
	call	Inorder
.L23:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	Inorder, .-Inorder
	.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:
