	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rbtree_delete                  ## -- Begin function rbtree_delete
	.p2align	4, 0x90
_rbtree_delete:                         ## @rbtree_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_rbtree_search
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_23
## %bb.1:
	movq	%rax, %r13
	decl	(%r14)
	leaq	16(%rax), %r15
	movq	16(%rbx), %rcx
	movq	_RBTREE_NULL@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	$1, %r12d
	cmpq	%rax, %rcx
	je	LBB0_2
## %bb.3:
	leaq	8(%r13), %rdx
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	8(%rbx), %rdx
	cmpq	%rax, %rdx
	je	LBB0_4
## %bb.5:
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rdx, %r15
	movq	16(%rdx), %rdx
	cmpq	%rax, %rdx
	jne	LBB0_6
## %bb.7:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_swap_int8
	movq	24(%rbx), %rsi
	movq	%r14, %rdi
	movq	%rbx, %rdx
	movq	%r15, %rcx
	callq	_change_parent_ptr
	cmpq	%r15, 8(%rbx)
	je	LBB0_9
## %bb.8:
	movq	24(%r15), %rsi
	movq	%r14, %rdi
	movq	%r15, %rdx
	movq	%rbx, %rcx
	callq	_change_parent_ptr
LBB0_9:
	leaq	16(%r15), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	addq	$24, %r13
	movq	16(%r15), %rdi
	movq	%r15, %rsi
	movq	%rbx, %rdx
	callq	_change_child_ptr
	movq	16(%r15), %rdi
	movq	%r15, %rsi
	movq	%rbx, %rdx
	callq	_change_child_ptr
	leaq	8(%r15), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	8(%r15), %rdi
	movq	%r15, %rsi
	movq	%rbx, %rdx
	callq	_change_child_ptr
	movq	8(%r15), %rdi
	movq	%r15, %rsi
	movq	%rbx, %rdx
	callq	_change_child_ptr
	movq	16(%rbx), %rdi
	movq	%rbx, %rsi
	movq	%r15, %rdx
	callq	_change_child_ptr
	movq	8(%rbx), %rdi
	cmpq	%r15, %rdi
	je	LBB0_11
## %bb.10:
	movq	%rbx, %rsi
	movq	%r15, %rdx
	callq	_change_child_ptr
	cmpq	%r15, 8(%rbx)
	jne	LBB0_12
LBB0_11:
	movq	%rbx, 8(%rbx)
	movq	%r15, 24(%r15)
LBB0_12:
	addq	$24, %r15
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_swap_np
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_swap_np
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_swap_np
	movq	(%r15), %rcx
	movq	_RBTREE_NULL@GOTPCREL(%rip), %r13
	movq	(%r13), %rax
	cmpq	%rax, %rcx
	jne	LBB0_14
	jmp	LBB0_15
LBB0_2:
	movq	_RBTREE_NULL@GOTPCREL(%rip), %r13
	jmp	LBB0_15
LBB0_4:
	movq	_RBTREE_NULL@GOTPCREL(%rip), %r13
	cmpq	%rax, %rcx
	je	LBB0_15
LBB0_14:
	xorl	%r12d, %r12d
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	cmpq	%rax, (%rcx)
	sete	%r12b
LBB0_15:
	movl	%r12d, %edi
	callq	_log_assert
	movq	(%r15), %r15
	cmpq	(%r13), %r15
	jne	LBB0_17
## %bb.16:
	movq	8(%rbx), %r15
LBB0_17:
	movq	24(%rbx), %rsi
	movq	%r14, %rdi
	movq	%rbx, %rdx
	movq	%r15, %rcx
	callq	_change_parent_ptr
	movq	24(%rbx), %rdx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_change_child_ptr
	movq	_RED@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%rax, (%rbx)
	je	LBB0_22
## %bb.18:
	cmpq	%rax, (%r15)
	jne	LBB0_21
## %bb.19:
	cmpq	(%r13), %r15
	je	LBB0_22
## %bb.20:
	movq	_BLACK@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r15)
	jmp	LBB0_22
LBB0_21:
	movq	24(%rbx), %rdx
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_rbtree_delete_fixup
LBB0_22:
	movq	(%r13), %rax
	movq	%rax, 24(%rbx)
	movq	%rax, 16(%rbx)
	movq	%rax, 8(%rbx)
	movq	_BLACK@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rbx)
LBB0_23:
	movq	%rbx, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RBTREE_NULL,8,3                ## @RBTREE_NULL
	.comm	_RED,8,3                        ## @RED
	.comm	_BLACK,8,3                      ## @BLACK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rbtree_delete                  ; -- Begin function rbtree_delete
	.p2align	2
_rbtree_delete:                         ; @rbtree_delete
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x0
	bl	_rbtree_search
	mov	x19, x0
	cbz	x0, LBB0_21
; %bb.1:
	ldr	w8, [x20]
	sub	w8, w8, #1
	str	w8, [x20]
	mov	x21, x19
	ldr	x9, [x21, #16]!
Lloh0:
	adrp	x27, _RBTREE_NULL@GOTPAGE
Lloh1:
	ldr	x27, [x27, _RBTREE_NULL@GOTPAGEOFF]
	ldr	x8, [x27]
	cmp	x9, x8
	b.eq	LBB0_12
; %bb.2:
	mov	x22, x19
	ldr	x10, [x22, #8]!
	cmp	x10, x8
	b.eq	LBB0_10
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x23, x10
	ldr	x10, [x10, #16]
	cmp	x10, x8
	b.ne	LBB0_3
; %bb.4:
	add	x24, x23, #16
	mov	x0, x19
	mov	x1, x23
	bl	_swap_int8
	mov	x25, x19
	ldr	x1, [x25, #24]!
	mov	x0, x20
	mov	x2, x19
	mov	x3, x23
	bl	_change_parent_ptr
	ldr	x8, [x19, #8]
	cmp	x8, x23
	b.eq	LBB0_6
; %bb.5:
	ldr	x1, [x23, #24]
	mov	x0, x20
	mov	x2, x23
	mov	x3, x19
	bl	_change_parent_ptr
LBB0_6:
	ldr	x0, [x23, #16]
	mov	x1, x23
	mov	x2, x19
	bl	_change_child_ptr
	ldr	x0, [x23, #16]
	mov	x1, x23
	mov	x2, x19
	bl	_change_child_ptr
	mov	x26, x23
	ldr	x0, [x26, #8]!
	mov	x1, x23
	mov	x2, x19
	bl	_change_child_ptr
	ldr	x0, [x26]
	mov	x1, x23
	mov	x2, x19
	bl	_change_child_ptr
	ldr	x0, [x19, #16]
	mov	x1, x19
	mov	x2, x23
	bl	_change_child_ptr
	ldr	x0, [x19, #8]
	cmp	x0, x23
	b.eq	LBB0_8
; %bb.7:
	mov	x1, x19
	mov	x2, x23
	bl	_change_child_ptr
	ldr	x8, [x19, #8]
	cmp	x8, x23
	b.ne	LBB0_9
LBB0_8:
	str	x19, [x19, #8]
	str	x23, [x23, #24]
LBB0_9:
	add	x1, x23, #24
	mov	x0, x25
	bl	_swap_np
	mov	x0, x21
	mov	x1, x24
	bl	_swap_np
	mov	x0, x22
	mov	x1, x26
	bl	_swap_np
	ldr	x9, [x21]
	ldr	x8, [x27]
LBB0_10:
	cmp	x9, x8
	b.eq	LBB0_12
; %bb.11:
	ldr	x9, [x22]
	cmp	x9, x8
	cset	w0, eq
	b	LBB0_13
LBB0_12:
	mov	w0, #1
LBB0_13:
	bl	_log_assert
	ldr	x21, [x21]
	ldr	x8, [x27]
	cmp	x21, x8
	b.ne	LBB0_15
; %bb.14:
	ldr	x21, [x19, #8]
LBB0_15:
	ldr	x1, [x19, #24]
	mov	x0, x20
	mov	x2, x19
	mov	x3, x21
	bl	_change_parent_ptr
	ldr	x2, [x19, #24]
	mov	x0, x21
	mov	x1, x19
	bl	_change_child_ptr
	ldr	x9, [x19]
Lloh2:
	adrp	x8, _RED@GOTPAGE
Lloh3:
	ldr	x8, [x8, _RED@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
Lloh5:
	adrp	x22, _BLACK@GOTPAGE
Lloh6:
	ldr	x22, [x22, _BLACK@GOTPAGEOFF]
	cmp	x9, x8
	b.eq	LBB0_20
; %bb.16:
	ldr	x9, [x21]
	cmp	x9, x8
	b.ne	LBB0_19
; %bb.17:
	ldr	x8, [x27]
	cmp	x21, x8
	b.eq	LBB0_20
; %bb.18:
	ldr	x8, [x22]
	str	x8, [x21]
	b	LBB0_20
LBB0_19:
	ldr	x2, [x19, #24]
	mov	x0, x20
	mov	x1, x21
	bl	_rbtree_delete_fixup
LBB0_20:
	ldr	x8, [x27]
	stp	x8, x8, [x19, #16]
	ldr	x9, [x22]
	stp	x9, x8, [x19]
LBB0_21:
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_RBTREE_NULL,8,3                ; @RBTREE_NULL
	.comm	_RED,8,3                        ; @RED
	.comm	_BLACK,8,3                      ; @BLACK
.subsections_via_symbols
