	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tree_delete
_tree_delete:                           ## @tree_delete
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, -32(%rbp)
	testq	%rdi, %rdi
	je	LBB0_1
## %bb.2:
	movl	(%rdi), %edx
	cmpl	%esi, %edx
	jne	LBB0_11
## %bb.3:
	leaq	-32(%rbp), %r14
	jmp	LBB0_4
LBB0_1:
	xorl	%edi, %edi
	jmp	LBB0_15
LBB0_11:
	movq	%rdi, %rax
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	%rax, %rbx
	xorl	%ecx, %ecx
	cmpl	%esi, %edx
	setle	%cl
	movq	16(%rax,%rcx,8), %rax
	testq	%rax, %rax
	je	LBB0_15
## %bb.9:                               ##   in Loop: Header=BB0_12 Depth=1
	movl	(%rax), %edx
	cmpl	%esi, %edx
	jne	LBB0_12
## %bb.10:
	leaq	(%rbx,%rcx,8), %r14
	addq	$16, %r14
	movq	%rax, %rdi
LBB0_4:
	movq	16(%rdi), %rbx
	movq	24(%rdi), %r15
	callq	_free_tree_node
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	%r15, (%r14)
	movq	16(%r15), %rax
	addq	$16, %r15
	movq	%r15, %r14
	movq	%rax, %r15
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	testq	%rbx, %rbx
	setne	%al
	je	LBB0_14
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	testq	%r15, %r15
	je	LBB0_14
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	8(%rbx), %rax
	cmpq	8(%r15), %rax
	jle	LBB0_13
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%rbx, (%r14)
	movq	24(%rbx), %rax
	addq	$24, %rbx
	movq	%rbx, %r14
	movq	%rax, %rbx
	jmp	LBB0_5
LBB0_14:
	testb	%al, %al
	cmoveq	%r15, %rbx
	movq	%rbx, (%r14)
	movq	-32(%rbp), %rdi
LBB0_15:
	movq	%rdi, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_tree_delete
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tree_delete
_tree_delete:                           ; @tree_delete
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	str	x0, [sp, #8]
	cbz	x0, LBB0_15
; %bb.1:
	ldr	w11, [x0]
	cmp	w11, w1
	b.ne	LBB0_3
; %bb.2:
	add	x19, sp, #8
	b	LBB0_7
LBB0_3:
	mov	w8, #24
	mov	w10, #16
	mov	x9, x0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	add	x12, x9, #16
	add	x13, x9, #24
	cmp	w11, w1
	csel	x11, x10, x8, gt
	csel	x19, x12, x13, gt
	ldr	x9, [x9, x11]
	cbz	x9, LBB0_15
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w11, [x9]
	cmp	w11, w1
	b.ne	LBB0_4
; %bb.6:
	mov	x0, x9
LBB0_7:
	ldp	x20, x21, [x0, #16]
	bl	_free_tree_node
	cmp	x20, #0
	cset	w8, ne
	cbz	x20, LBB0_14
; %bb.8:
	cbz	x21, LBB0_14
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #8]
	ldr	x9, [x21, #8]
	cmp	x8, x9
	b.le	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	str	x20, [x19]
	ldr	x8, [x20, #24]!
	mov	x19, x20
	mov	x20, x8
	b	LBB0_12
LBB0_11:                                ;   in Loop: Header=BB0_9 Depth=1
	str	x21, [x19]
	ldr	x8, [x21, #16]!
	mov	x19, x21
	mov	x21, x8
LBB0_12:                                ;   in Loop: Header=BB0_9 Depth=1
	cmp	x20, #0
	cset	w8, ne
	cbz	x20, LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_9 Depth=1
	cbnz	x21, LBB0_9
LBB0_14:
	cmp	w8, #0
	csel	x8, x20, x21, ne
	str	x8, [x19]
	ldr	x0, [sp, #8]
LBB0_15:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_tree_delete
.subsections_via_symbols
