	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___bt_search                    ## -- Begin function __bt_search
	.p2align	4, 0x90
___bt_search:                           ## @__bt_search
	.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	%rdx, %r14
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, %rbx
	callq	_BT_CLR
	movq	_P_ROOT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%rbx), %edi
	xorl	%edx, %edx
	callq	_mpool_get
	testq	%rax, %rax
	je	LBB0_11
## %bb.1:
	movq	%rax, %r13
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	leaq	8(%rbx), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	_P_BLEAF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r13)
	jne	LBB0_17
LBB0_3:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	24(%r13), %esi
	movq	%rbx, %rdi
	movl	%r14d, %edx
	callq	_BT_PUSH
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	_GETBINTERNAL
	movl	(%rax), %r14d
	movl	(%rbx), %edi
	movq	%r13, %rsi
	xorl	%edx, %edx
	callq	_mpool_put
	movl	(%rbx), %edi
	movl	%r14d, %esi
	xorl	%edx, %edx
	callq	_mpool_get
	movq	%rax, %r13
	testq	%rax, %rax
	je	LBB0_11
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
	movq	%r13, 16(%rbx)
	movq	%r13, %rdi
	callq	_NEXTINDEX
	testl	%eax, %eax
	je	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	%eax, %r15d
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_6:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%r15d, %r14d
	sarl	%r14d
	addl	%r12d, %r14d
	movl	%r14d, 8(%rbx)
	movq	%rbx, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	callq	___bt_cmp
	testl	%eax, %eax
	je	LBB0_2
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=2
	incl	%r14d
	xorl	%ecx, %ecx
	testl	%eax, %eax
	cmovgl	%r14d, %r12d
	setg	%cl
	subl	%ecx, %r15d
	movl	%r15d, %eax
	sarl	%eax
	cmpl	$1, %r15d
	movl	%eax, %r15d
	ja	LBB0_6
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	xorl	%r12d, %r12d
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	_P_BLEAF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r13)
	jne	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=1
	subl	$1, %r12d
	movl	$0, %eax
	cmovbl	%eax, %r12d
	movl	%r12d, %r14d
	jmp	LBB0_3
LBB0_11:
	xorl	%eax, %eax
	jmp	LBB0_23
LBB0_12:
	movq	_B_NODUPS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_F_ISSET
	testl	%eax, %eax
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	jne	LBB0_22
## %bb.13:
	testl	%r12d, %r12d
	jne	LBB0_18
## %bb.14:
	movq	8(%r13), %rax
	movq	_P_INVALID@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_18
## %bb.15:
	movq	%rbx, %rdi
	movq	%r13, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movq	%r14, %rcx
	callq	___bt_sprev
	testq	%rax, %rax
	jne	LBB0_16
LBB0_18:
	movq	%r13, %rdi
	callq	_NEXTINDEX
	cmpl	%eax, %r12d
	jne	LBB0_22
## %bb.19:
	movq	16(%r13), %rax
	movq	_P_INVALID@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_22
## %bb.20:
	movq	%rbx, %rdi
	movq	%r13, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movq	%r14, %rcx
	callq	___bt_snext
	testq	%rax, %rax
	je	LBB0_22
LBB0_16:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	jmp	LBB0_23
LBB0_22:
	movl	$0, (%r14)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	%r12d, (%rax)
	jmp	LBB0_23
LBB0_17:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	$1, (%rax)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
LBB0_23:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_P_ROOT,4,2                     ## @P_ROOT
	.comm	_P_BLEAF,4,2                    ## @P_BLEAF
	.comm	_B_NODUPS,4,2                   ## @B_NODUPS
	.comm	_P_INVALID,8,3                  ## @P_INVALID
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___bt_search                    ; -- Begin function __bt_search
	.p2align	2
___bt_search:                           ; @__bt_search
	.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	x19, x2
	mov	x21, x1
	mov	x22, x0
	bl	_BT_CLR
Lloh0:
	adrp	x8, _P_ROOT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _P_ROOT@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	ldr	w0, [x22]
	mov	w2, #0
	bl	_mpool_get
	cbz	x0, LBB0_11
; %bb.1:
	mov	x23, x0
	add	x20, x22, #8
Lloh3:
	adrp	x26, _P_BLEAF@GOTPAGE
Lloh4:
	ldr	x26, [x26, _P_BLEAF@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x23]
	ldr	w9, [x26]
	tst	w9, w8
	b.ne	LBB0_20
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w1, [x23, #24]
	mov	x0, x22
	mov	x2, x24
	bl	_BT_PUSH
	mov	x0, x23
	mov	x1, x24
	bl	_GETBINTERNAL
	ldr	w24, [x0]
	ldr	w0, [x22]
	mov	x1, x23
	mov	w2, #0
	bl	_mpool_put
	ldr	w0, [x22]
	mov	x1, x24
	mov	w2, #0
	bl	_mpool_get
	mov	x23, x0
	cbz	x0, LBB0_11
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
	str	x23, [x22, #16]
	mov	x0, x23
	bl	_NEXTINDEX
	cbz	w0, LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x25, x0
	mov	w27, #0
LBB0_6:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	w24, w27, w25, asr #1
	str	w24, [x22, #8]
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	bl	___bt_cmp
	cbz	w0, LBB0_2
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=2
	cmp	w0, #0
	cset	w8, gt
	csinc	w27, w27, w24, le
	sub	w8, w25, w8
	asr	w25, w8, #1
	cmp	w8, #1
	b.hi	LBB0_6
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	w27, #0
LBB0_9:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x23]
	ldr	w9, [x26]
	tst	w9, w8
	b.ne	LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_4 Depth=1
	sub	w8, w27, #1
	cmp	w27, #0
	csel	w24, wzr, w8, eq
	b	LBB0_3
LBB0_11:
	mov	x20, #0
	b	LBB0_21
LBB0_12:
Lloh5:
	adrp	x8, _B_NODUPS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _B_NODUPS@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_F_ISSET
	cbnz	w0, LBB0_19
; %bb.13:
	cbnz	w27, LBB0_16
; %bb.14:
	ldr	x8, [x23, #8]
Lloh8:
	adrp	x9, _P_INVALID@GOTPAGE
Lloh9:
	ldr	x9, [x9, _P_INVALID@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_16
; %bb.15:
	mov	x0, x22
	mov	x1, x23
	mov	x2, x21
	mov	x3, x19
	bl	___bt_sprev
	cbnz	x0, LBB0_21
LBB0_16:
	mov	x0, x23
	bl	_NEXTINDEX
	cmp	w27, w0
	b.ne	LBB0_19
; %bb.17:
	ldr	x8, [x23, #16]
Lloh11:
	adrp	x9, _P_INVALID@GOTPAGE
Lloh12:
	ldr	x9, [x9, _P_INVALID@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_19
; %bb.18:
	mov	x0, x22
	mov	x1, x23
	mov	x2, x21
	mov	x3, x19
	bl	___bt_snext
	cbnz	x0, LBB0_21
LBB0_19:
	str	wzr, [x19]
	str	w27, [x20]
	b	LBB0_21
LBB0_20:
	mov	w8, #1
	str	w8, [x19]
LBB0_21:
	mov	x0, x20
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_P_ROOT,4,2                     ; @P_ROOT
	.comm	_P_BLEAF,4,2                    ; @P_BLEAF
	.comm	_B_NODUPS,4,2                   ; @B_NODUPS
	.comm	_P_INVALID,8,3                  ; @P_INVALID
.subsections_via_symbols
