	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _bt_findinsertloc
__bt_findinsertloc:                     ## @_bt_findinsertloc
	.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
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	movl	%ecx, -68(%rbp)                 ## 4-byte Spill
	movl	%edx, -64(%rbp)                 ## 4-byte Spill
	movq	%rsi, %rbx
	movl	%edi, -60(%rbp)                 ## 4-byte Spill
	movq	40(%rsi), %r14
	movl	32(%rsi), %edi
	callq	_BufferGetPage
	movl	%eax, %r12d
	movl	%eax, %edi
	callq	_PageGetSpecialPointer
	movq	%rax, %r13
	movq	(%rbx), %r15
	movl	%r12d, %edi
	callq	_BTMaxItemSize
	xorl	%edi, %edi
	cmpq	%rax, %r15
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	setg	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	(%r14), %rdx
	movl	36(%rbx), %r8d
	movl	-60(%rbp), %edi                 ## 4-byte Reload
	movl	%r15d, %esi
	movl	%r12d, %ecx
	callq	__bt_check_third_page
LBB0_2:
	movl	-60(%rbp), %r15d                ## 4-byte Reload
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	%r13, %rdi
	callq	_P_ISLEAF
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%r13, %rdi
	callq	_P_INCOMPLETE_SPLIT
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	jmp	LBB0_5
LBB0_3:
	xorl	%edi, %edi
LBB0_5:
	movl	%r15d, %r14d
	callq	_Assert
	cmpl	$0, 8(%rbx)
	sete	%al
	cmpl	$0, -64(%rbp)                   ## 4-byte Folded Reload
	setne	%cl
	orb	%al, %cl
	movzbl	%cl, %edi
	callq	_Assert
	movl	$1, %r15d
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	cmpq	$0, (%rax)
	movl	$1, %edi
	je	LBB0_7
## %bb.6:
	xorl	%edi, %edi
	cmpq	$0, 8(%rax)
	setne	%dil
LBB0_7:
	callq	_Assert
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	cmpq	$0, (%rax)
	jne	LBB0_9
## %bb.8:
	xorl	%r15d, %r15d
	cmpq	$0, 8(%rax)
	sete	%r15b
LBB0_9:
	movl	%r15d, %edi
	callq	_Assert
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	cmpq	$0, (%rax)
	je	LBB0_10
## %bb.20:
	cmpl	$0, -64(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_27
	.p2align	4, 0x90
## %bb.21:
	cmpl	$0, 8(%rbx)
	je	LBB0_24
LBB0_22:
	movq	24(%rbx), %r15
	cmpq	%r15, 16(%rbx)
	jg	LBB0_24
## %bb.23:
	movl	%r12d, %edi
	callq	_PageGetMaxOffsetNumber
	cmpq	%rax, %r15
	jle	LBB0_27
LBB0_24:                                ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	callq	_P_RIGHTMOST
	testq	%rax, %rax
	jne	LBB0_27
## %bb.25:                              ##   in Loop: Header=BB0_24 Depth=1
	movq	_P_HIKEY@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%r14d, %edi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	%r12d, %edx
	callq	__bt_compare
	testq	%rax, %rax
	jle	LBB0_27
## %bb.26:                              ##   in Loop: Header=BB0_24 Depth=1
	movl	%r14d, %edi
	movq	%rbx, %rsi
	movl	-68(%rbp), %edx                 ## 4-byte Reload
	callq	__bt_stepright
	movl	32(%rbx), %edi
	callq	_BufferGetPage
	movl	%eax, %r12d
	movl	%eax, %edi
	callq	_PageGetSpecialPointer
	movq	%rax, %r13
	cmpl	$0, 8(%rbx)
	jne	LBB0_22
	jmp	LBB0_24
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_10 Depth=1
	movq	%r13, %rdi
	callq	_P_HAS_GARBAGE
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_10 Depth=1
	movl	32(%rbx), %esi
	movl	%r14d, %edi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	__bt_vacuum_one_page
	movl	$0, 8(%rbx)
	movl	%r12d, %edi
	callq	_PageGetFreeSpace
	cmpq	(%rbx), %rax
	jge	LBB0_30
LBB0_13:                                ##   in Loop: Header=BB0_10 Depth=1
	cmpl	$0, 8(%rbx)
	je	LBB0_16
## %bb.14:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	24(%rbx), %r15
	cmpq	%r15, 16(%rbx)
	jg	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_10 Depth=1
	movl	%r12d, %edi
	callq	_PageGetMaxOffsetNumber
	cmpq	%rax, %r15
	jle	LBB0_30
LBB0_16:                                ##   in Loop: Header=BB0_10 Depth=1
	movq	%r13, %rdi
	callq	_P_RIGHTMOST
	testq	%rax, %rax
	jne	LBB0_30
## %bb.17:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	_P_HIKEY@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%r14d, %edi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	%r12d, %edx
	callq	__bt_compare
	testq	%rax, %rax
	jne	LBB0_30
## %bb.18:                              ##   in Loop: Header=BB0_10 Depth=1
	xorl	%eax, %eax
	callq	_random
	movq	_MAX_RANDOM_VALUE@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	imulq	$1374389535, %rcx, %rcx         ## imm = 0x51EB851F
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$37, %rcx
	addl	%edx, %ecx
	cmpl	%ecx, %eax
	jle	LBB0_30
## %bb.19:                              ##   in Loop: Header=BB0_10 Depth=1
	movl	%r14d, %edi
	movq	%rbx, %rsi
	movl	-68(%rbp), %edx                 ## 4-byte Reload
	callq	__bt_stepright
	movl	32(%rbx), %edi
	callq	_BufferGetPage
	movl	%eax, %r12d
	movl	%eax, %edi
	callq	_PageGetSpecialPointer
	movq	%rax, %r13
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	%r12d, %edi
	callq	_PageGetFreeSpace
	cmpq	(%rbx), %rax
	jl	LBB0_11
	jmp	LBB0_30
LBB0_27:
	movl	%r12d, %edi
	callq	_PageGetFreeSpace
	cmpq	(%rbx), %rax
	jge	LBB0_30
## %bb.28:
	movq	%r13, %rdi
	callq	_P_HAS_GARBAGE
	testq	%rax, %rax
	je	LBB0_30
## %bb.29:
	movl	32(%rbx), %esi
	movl	%r14d, %edi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	__bt_vacuum_one_page
	movl	$0, 8(%rbx)
LBB0_30:
	movq	%r13, %rdi
	callq	_P_RIGHTMOST
	movl	$1, %edi
	testq	%rax, %rax
	jne	LBB0_32
## %bb.31:
	movq	_P_HIKEY@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%r14d, %edi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	%r12d, %edx
	callq	__bt_compare
	xorl	%edi, %edi
	testq	%rax, %rax
	setle	%dil
LBB0_32:
	callq	_Assert
	movl	%r14d, %edi
	movq	%rbx, %rsi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	__bt_binsrch_insert             ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_P_HIKEY,4,2                    ## @P_HIKEY
	.comm	_MAX_RANDOM_VALUE,4,2           ## @MAX_RANDOM_VALUE
	.no_dead_strip	__bt_findinsertloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _bt_findinsertloc
__bt_findinsertloc:                     ; @_bt_findinsertloc
	.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	x23, x4
	mov	x25, x3
	mov	x26, x2
	mov	x19, x1
	mov	x20, x0
	ldr	x21, [x1, #40]
	ldr	w0, [x1, #32]
	bl	_BufferGetPage
	mov	x22, x0
	bl	_PageGetSpecialPointer
	mov	x24, x0
	ldr	x27, [x19]
	mov	x0, x22
	bl	_BTMaxItemSize
	cmp	x27, x0
	cset	w0, gt
	bl	_unlikely
	cbz	x0, LBB0_2
; %bb.1:
	ldr	x2, [x21]
	ldr	w4, [x19, #36]
	mov	x0, x20
	mov	x1, x23
	mov	x3, x22
	bl	__bt_check_third_page
LBB0_2:
	mov	x0, x24
	bl	_P_ISLEAF
	cbz	x0, LBB0_4
; %bb.3:
	mov	x0, x24
	bl	_P_INCOMPLETE_SPLIT
	cmp	w0, #0
	cset	w0, eq
LBB0_4:
	bl	_Assert
	ldr	w8, [x19, #8]
	cmp	w26, #0
	ccmp	w8, #0, #4, eq
	cset	w0, eq
	bl	_Assert
	ldr	x8, [x21]
	cbz	x8, LBB0_6
; %bb.5:
	ldr	x8, [x21, #8]
	cmp	x8, #0
	cset	w0, ne
	b	LBB0_7
LBB0_6:
	mov	w0, #1
LBB0_7:
	bl	_Assert
	ldr	x8, [x21]
	cbz	x8, LBB0_9
; %bb.8:
	mov	w0, #1
	b	LBB0_10
LBB0_9:
	ldr	x8, [x21, #8]
	cmp	x8, #0
	cset	w0, eq
LBB0_10:
	bl	_Assert
	ldr	x8, [x21]
	cbz	x8, LBB0_21
; %bb.11:
	cbz	w26, LBB0_18
; %bb.12:
Lloh0:
	adrp	x26, _P_HIKEY@GOTPAGE
Lloh1:
	ldr	x26, [x26, _P_HIKEY@GOTPAGEOFF]
	ldr	w8, [x19, #8]
	cbz	w8, LBB0_15
LBB0_13:
	ldp	x8, x27, [x19, #16]
	cmp	x8, x27
	b.gt	LBB0_15
; %bb.14:
	mov	x0, x22
	bl	_PageGetMaxOffsetNumber
	cmp	x27, x0
	b.le	LBB0_18
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x24
	bl	_P_RIGHTMOST
	cbnz	x0, LBB0_18
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	ldr	w3, [x26]
	mov	x0, x20
	mov	x1, x21
	mov	x2, x22
	bl	__bt_compare
	cmp	x0, #1
	b.lt	LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	x0, x20
	mov	x1, x19
	mov	x2, x25
	bl	__bt_stepright
	ldr	w0, [x19, #32]
	bl	_BufferGetPage
	mov	x22, x0
	bl	_PageGetSpecialPointer
	mov	x24, x0
	ldr	w8, [x19, #8]
	cbnz	w8, LBB0_13
	b	LBB0_15
LBB0_18:
	mov	x0, x22
	bl	_PageGetFreeSpace
	ldr	x8, [x19]
	cmp	x0, x8
	b.ge	LBB0_32
; %bb.19:
	mov	x0, x24
	bl	_P_HAS_GARBAGE
	cbz	x0, LBB0_32
; %bb.20:
	ldr	w1, [x19, #32]
	mov	x0, x20
	mov	x2, x23
	bl	__bt_vacuum_one_page
	str	wzr, [x19, #8]
	b	LBB0_32
LBB0_21:
	mov	x0, x22
	bl	_PageGetFreeSpace
	ldr	x8, [x19]
	cmp	x0, x8
	b.ge	LBB0_32
; %bb.22:
Lloh2:
	adrp	x26, _P_HIKEY@GOTPAGE
Lloh3:
	ldr	x26, [x26, _P_HIKEY@GOTPAGEOFF]
	mov	w28, #34079
	movk	w28, #20971, lsl #16
LBB0_23:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x24
	bl	_P_HAS_GARBAGE
	cbz	x0, LBB0_25
; %bb.24:                               ;   in Loop: Header=BB0_23 Depth=1
	ldr	w1, [x19, #32]
	mov	x0, x20
	mov	x2, x23
	bl	__bt_vacuum_one_page
	str	wzr, [x19, #8]
	mov	x0, x22
	bl	_PageGetFreeSpace
	ldr	x8, [x19]
	cmp	x0, x8
	b.ge	LBB0_32
LBB0_25:                                ;   in Loop: Header=BB0_23 Depth=1
	ldr	w8, [x19, #8]
	cbz	w8, LBB0_28
; %bb.26:                               ;   in Loop: Header=BB0_23 Depth=1
	ldp	x8, x27, [x19, #16]
	cmp	x8, x27
	b.gt	LBB0_28
; %bb.27:                               ;   in Loop: Header=BB0_23 Depth=1
	mov	x0, x22
	bl	_PageGetMaxOffsetNumber
	cmp	x27, x0
	b.le	LBB0_32
LBB0_28:                                ;   in Loop: Header=BB0_23 Depth=1
	mov	x0, x24
	bl	_P_RIGHTMOST
	cbnz	x0, LBB0_32
; %bb.29:                               ;   in Loop: Header=BB0_23 Depth=1
	ldr	w3, [x26]
	mov	x0, x20
	mov	x1, x21
	mov	x2, x22
	bl	__bt_compare
	cbnz	x0, LBB0_32
; %bb.30:                               ;   in Loop: Header=BB0_23 Depth=1
	bl	_random
Lloh4:
	adrp	x8, _MAX_RANDOM_VALUE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _MAX_RANDOM_VALUE@GOTPAGEOFF]
Lloh6:
	ldrsw	x8, [x8]
	mul	x8, x8, x28
	lsr	x9, x8, #63
	asr	x8, x8, #37
	add	w8, w8, w9
	cmp	w0, w8
	b.le	LBB0_32
; %bb.31:                               ;   in Loop: Header=BB0_23 Depth=1
	mov	x0, x20
	mov	x1, x19
	mov	x2, x25
	bl	__bt_stepright
	ldr	w0, [x19, #32]
	bl	_BufferGetPage
	mov	x22, x0
	bl	_PageGetSpecialPointer
	mov	x24, x0
	mov	x0, x22
	bl	_PageGetFreeSpace
	ldr	x8, [x19]
	cmp	x0, x8
	b.lt	LBB0_23
LBB0_32:
	mov	x0, x24
	bl	_P_RIGHTMOST
	cbz	x0, LBB0_34
; %bb.33:
	mov	w0, #1
	b	LBB0_35
LBB0_34:
Lloh7:
	adrp	x8, _P_HIKEY@GOTPAGE
Lloh8:
	ldr	x8, [x8, _P_HIKEY@GOTPAGEOFF]
Lloh9:
	ldr	w3, [x8]
	mov	x0, x20
	mov	x1, x21
	mov	x2, x22
	bl	__bt_compare
	cmp	x0, #1
	cset	w0, lt
LBB0_35:
	bl	_Assert
	mov	x0, x20
	mov	x1, 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
	b	__bt_binsrch_insert
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_P_HIKEY,4,2                    ; @P_HIKEY
	.comm	_MAX_RANDOM_VALUE,4,2           ; @MAX_RANDOM_VALUE
	.no_dead_strip	__bt_findinsertloc
.subsections_via_symbols
