	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __bt_bdelete
___bt_bdelete:                          ## @__bt_bdelete
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, %r14
	leaq	-44(%rbp), %rdx
	callq	___bt_search
	testq	%rax, %rax
	je	LBB0_17
## %bb.1:
	movl	-44(%rbp), %ebx
	testl	%ebx, %ebx
	je	LBB0_19
## %bb.2:
	movq	%rax, %r15
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
                                        ##     Child Loop BB0_9 Depth 2
	movq	8(%r15), %r13
	.p2align	4, 0x90
LBB0_4:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%r15), %rcx
	movq	%r14, %rdi
	movq	%r12, %rsi
	movq	%r13, %rdx
	callq	___bt_dleaf
	testl	%eax, %eax
	jne	LBB0_22
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=2
	movq	_B_NODUPS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_F_ISSET
	testq	%rax, %rax
	jne	LBB0_23
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=2
	movq	(%r15), %rbx
	movq	%r13, %rdi
	callq	_NEXTINDEX
	cmpq	%rax, %rbx
	jge	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=2
	movq	%r14, %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	callq	___bt_cmp
	testq	%rax, %rax
	je	LBB0_4
LBB0_8:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movq	(%r15), %rbx
	movq	%r13, %rdi
	callq	_NEXTINDEX
	xorl	%r12d, %r12d
	cmpq	%rax, %rbx
	sete	%r12b
	movq	(%r15), %rax
	leaq	-1(%rax), %rcx
	movq	%rcx, (%r15)
	testq	%rax, %rax
	jle	LBB0_12
	.p2align	4, 0x90
LBB0_9:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r14, %rdi
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rsi
	movq	%r15, %rdx
	callq	___bt_cmp
	testq	%rax, %rax
	jne	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=2
	movq	(%r15), %rcx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movq	%r13, %rdx
	callq	___bt_dleaf
	movq	_RET_ERROR@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_22
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=2
	movq	(%r15), %rax
	subq	$1, %rax
	movl	$1, %ecx
	cmovbl	%ecx, %r12d
	movq	%rax, (%r15)
	jge	LBB0_9
LBB0_12:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	%r13, %rdi
	callq	_NEXTINDEX
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r14), %edi
	movq	_MPOOL_DIRTY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rsi
	callq	_mpool_put
	testl	%r12d, %r12d
	jne	LBB0_15
	jmp	LBB0_27
LBB0_14:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	___bt_pdelete
	testq	%rax, %rax
	jne	LBB0_18
LBB0_15:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %rdi
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rsi
	leaq	-44(%rbp), %rdx
	callq	___bt_search
	movq	%rax, %r15
	testq	%rax, %rax
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	je	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$0, -44(%rbp)
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	jne	LBB0_3
	jmp	LBB0_20
LBB0_17:
	testq	%rax, %rax
	jne	LBB0_27
LBB0_18:
	movq	_RET_ERROR@GOTPCREL(%rip), %rax
	jmp	LBB0_28
LBB0_19:
	movq	%rax, %r15
LBB0_20:
	movl	(%r14), %edi
	movq	8(%r15), %rsi
	xorl	%edx, %edx
	callq	_mpool_put
	testl	%ebx, %ebx
	jne	LBB0_27
## %bb.21:
	movq	_RET_SPECIAL@GOTPCREL(%rip), %rax
	jmp	LBB0_28
LBB0_22:
	movl	(%r14), %edi
	movq	%r13, %rsi
	xorl	%edx, %edx
	callq	_mpool_put
	movq	_RET_ERROR@GOTPCREL(%rip), %rax
	jmp	LBB0_28
LBB0_23:
	movq	%r13, %rdi
	callq	_NEXTINDEX
	testq	%rax, %rax
	je	LBB0_25
## %bb.24:
	movl	(%r14), %edi
	movq	_MPOOL_DIRTY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rsi
	callq	_mpool_put
	jmp	LBB0_27
LBB0_25:
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	___bt_pdelete
	testq	%rax, %rax
	jne	LBB0_18
LBB0_27:
	movq	_RET_SUCCESS@GOTPCREL(%rip), %rax
LBB0_28:
	movl	(%rax), %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RET_SUCCESS,4,2                ## @RET_SUCCESS
	.comm	_RET_ERROR,4,2                  ## @RET_ERROR
	.comm	_RET_SPECIAL,4,2                ## @RET_SPECIAL
	.comm	_B_NODUPS,4,2                   ## @B_NODUPS
	.comm	_MPOOL_DIRTY,4,2                ## @MPOOL_DIRTY
	.no_dead_strip	___bt_bdelete
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __bt_bdelete
___bt_bdelete:                          ; @__bt_bdelete
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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, x1
	mov	x19, x0
	add	x2, sp, #12
	bl	___bt_search
	mov	x21, x0
	cbz	x0, LBB0_17
; %bb.1:
	ldr	w25, [sp, #12]
	cbz	w25, LBB0_18
; %bb.2:
Lloh0:
	adrp	x27, _B_NODUPS@GOTPAGE
Lloh1:
	ldr	x27, [x27, _B_NODUPS@GOTPAGEOFF]
Lloh2:
	adrp	x24, _RET_ERROR@GOTPAGE
Lloh3:
	ldr	x24, [x24, _RET_ERROR@GOTPAGEOFF]
	mov	x23, x21
Lloh4:
	adrp	x26, _MPOOL_DIRTY@GOTPAGE
Lloh5:
	ldr	x26, [x26, _MPOOL_DIRTY@GOTPAGEOFF]
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_4 Depth 2
                                        ;     Child Loop BB0_9 Depth 2
	ldr	x22, [x23, #8]
LBB0_4:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x3, [x23]
	mov	x0, x19
	mov	x1, x20
	mov	x2, x22
	bl	___bt_dleaf
	cbnz	w0, LBB0_20
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=2
	ldr	w1, [x27]
	mov	x0, x19
	bl	_F_ISSET
	cbnz	x0, LBB0_21
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=2
	ldr	x28, [x23]
	mov	x0, x22
	bl	_NEXTINDEX
	cmp	x28, x0
	b.ge	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=2
	mov	x0, x19
	mov	x1, x20
	mov	x2, x23
	bl	___bt_cmp
	cbz	x0, LBB0_4
LBB0_8:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	x28, [x23]
	mov	x0, x22
	bl	_NEXTINDEX
	cmp	x28, x0
	cset	w28, eq
	ldr	x8, [x23]
	subs	x8, x8, #1
	str	x8, [x23]
	b.lt	LBB0_12
LBB0_9:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x19
	mov	x1, x20
	mov	x2, x23
	bl	___bt_cmp
	cbnz	x0, LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=2
	ldr	x3, [x23]
	mov	x0, x19
	mov	x1, x20
	mov	x2, x22
	bl	___bt_dleaf
	ldr	w8, [x24]
	cmp	w0, w8
	b.eq	LBB0_20
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=2
	ldr	x8, [x23]
	sub	x9, x8, #1
	str	x9, [x23]
	cmp	x8, #0
	csinc	w28, w28, wzr, ne
	b.gt	LBB0_9
LBB0_12:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x22
	bl	_NEXTINDEX
	cbz	x0, LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x19]
	ldr	w2, [x26]
	mov	x1, x22
	bl	_mpool_put
	cbnz	w28, LBB0_15
	b	LBB0_23
LBB0_14:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	mov	x1, x22
	bl	___bt_pdelete
	cbnz	x0, LBB0_27
LBB0_15:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x2, sp, #12
	mov	x0, x19
	mov	x1, x20
	bl	___bt_search
	cbz	x0, LBB0_17
; %bb.16:                               ;   in Loop: Header=BB0_3 Depth=1
	mov	x23, x0
	ldr	w8, [sp, #12]
	cbnz	w8, LBB0_3
	b	LBB0_19
LBB0_17:
Lloh6:
	adrp	x8, _RET_SUCCESS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _RET_SUCCESS@GOTPAGEOFF]
Lloh8:
	adrp	x9, _RET_ERROR@GOTPAGE
Lloh9:
	ldr	x9, [x9, _RET_ERROR@GOTPAGEOFF]
	cmp	x21, #0
	csel	x8, x9, x8, eq
	b	LBB0_24
LBB0_18:
	mov	x23, x21
LBB0_19:
	ldr	w0, [x19]
	ldr	x1, [x23, #8]
	mov	w2, #0
	bl	_mpool_put
Lloh10:
	adrp	x8, _RET_SUCCESS@GOTPAGE
Lloh11:
	ldr	x8, [x8, _RET_SUCCESS@GOTPAGEOFF]
Lloh12:
	adrp	x9, _RET_SPECIAL@GOTPAGE
Lloh13:
	ldr	x9, [x9, _RET_SPECIAL@GOTPAGEOFF]
	cmp	w25, #0
	csel	x8, x9, x8, eq
	b	LBB0_24
LBB0_20:
	ldr	w0, [x19]
	mov	x1, x22
	mov	w2, #0
	bl	_mpool_put
	ldr	w0, [x24]
	b	LBB0_25
LBB0_21:
	mov	x0, x22
	bl	_NEXTINDEX
	cbz	x0, LBB0_26
; %bb.22:
	ldr	w0, [x19]
	ldr	w2, [x26]
	mov	x1, x22
	bl	_mpool_put
LBB0_23:
Lloh14:
	adrp	x8, _RET_SUCCESS@GOTPAGE
Lloh15:
	ldr	x8, [x8, _RET_SUCCESS@GOTPAGEOFF]
LBB0_24:
	ldr	w0, [x8]
LBB0_25:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_26:
	mov	x0, x19
	mov	x1, x22
	bl	___bt_pdelete
	cbz	x0, LBB0_23
LBB0_27:
	ldr	w0, [x24]
	b	LBB0_25
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_RET_SUCCESS,4,2                ; @RET_SUCCESS
	.comm	_RET_ERROR,4,2                  ; @RET_ERROR
	.comm	_RET_SPECIAL,4,2                ; @RET_SPECIAL
	.comm	_B_NODUPS,4,2                   ; @B_NODUPS
	.comm	_MPOOL_DIRTY,4,2                ; @MPOOL_DIRTY
	.no_dead_strip	___bt_bdelete
.subsections_via_symbols
