	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function FreePageBtreeConsolidate
_FreePageBtreeConsolidate:              ## @FreePageBtreeConsolidate
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	callq	_fpm_segment_base
	movq	%rax, %r15
	movq	(%rbx), %rax
	movq	_FREE_PAGE_LEAF_MAGIC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movq	_FPM_ITEMS_PER_LEAF_PAGE@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_2:
	movq	_FREE_PAGE_INTERNAL_MAGIC@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	sete	%dil
	callq	_Assert
	movq	_FPM_ITEMS_PER_INTERNAL_PAGE@GOTPCREL(%rip), %rax
LBB0_3:
	movslq	(%rax), %r13
	imulq	$1431655766, %r13, %rax         ## imm = 0x55555556
	movq	%rax, %rcx
	shrq	$63, %rcx
	shrq	$32, %rax
	addl	%ecx, %eax
	cmpl	%eax, 8(%rbx)
	jge	LBB0_16
## %bb.4:
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_FreePageBtreeFindRightSibling
	testq	%rax, %rax
	je	LBB0_9
## %bb.5:
	movq	%rax, %r12
	movslq	8(%rbx), %rdi
	movl	8(%rax), %edx
	leal	(%rdx,%rdi), %eax
	cmpl	%r13d, %eax
	jle	LBB0_6
LBB0_9:
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_FreePageBtreeFindLeftSibling
	testq	%rax, %rax
	je	LBB0_16
## %bb.10:
	movq	%rax, %r12
	movl	8(%rbx), %edx
	movslq	8(%rax), %rdi
	leal	(%rdi,%rdx), %eax
	cmpl	%r13d, %eax
	jle	LBB0_11
LBB0_16:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	(%rbx), %rax
	movq	_FREE_PAGE_LEAF_MAGIC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.7:
	shlq	$2, %rdi
	addq	24(%rbx), %rdi
	movq	24(%r12), %rsi
	shll	$2, %edx
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memcpy
	movl	8(%r12), %eax
	addl	%eax, 8(%rbx)
	jmp	LBB0_15
LBB0_11:
	movq	(%rbx), %rax
	movq	_FREE_PAGE_LEAF_MAGIC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_13
## %bb.12:
	shlq	$2, %rdi
	addq	24(%r12), %rdi
	movq	24(%rbx), %rsi
	shll	$2, %edx
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memcpy
	movl	8(%rbx), %eax
	addl	%eax, 8(%r12)
	jmp	LBB0_14
LBB0_8:
	shlq	$2, %rdi
	addq	16(%rbx), %rdi
	movq	16(%r12), %rsi
	shll	$2, %edx
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memcpy
	movl	8(%r12), %eax
	addl	%eax, 8(%rbx)
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_FreePageBtreeUpdateParentPointers
	jmp	LBB0_15
LBB0_13:
	shlq	$2, %rdi
	addq	16(%r12), %rdi
	movq	16(%rbx), %rsi
	shll	$2, %edx
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memcpy
	movl	8(%rbx), %eax
	addl	%eax, 8(%r12)
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_FreePageBtreeUpdateParentPointers
LBB0_14:
	movq	%rbx, %r12
LBB0_15:
	movq	%r14, %rdi
	movq	%r12, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_FreePageBtreeRemovePage        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_FREE_PAGE_LEAF_MAGIC,8,3       ## @FREE_PAGE_LEAF_MAGIC
	.comm	_FPM_ITEMS_PER_LEAF_PAGE,4,2    ## @FPM_ITEMS_PER_LEAF_PAGE
	.comm	_FREE_PAGE_INTERNAL_MAGIC,8,3   ## @FREE_PAGE_INTERNAL_MAGIC
	.comm	_FPM_ITEMS_PER_INTERNAL_PAGE,4,2 ## @FPM_ITEMS_PER_INTERNAL_PAGE
	.no_dead_strip	_FreePageBtreeConsolidate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function FreePageBtreeConsolidate
_FreePageBtreeConsolidate:              ; @FreePageBtreeConsolidate
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x1
	mov	x19, x0
	bl	_fpm_segment_base
	mov	x21, x0
	ldr	x8, [x20]
Lloh0:
	adrp	x23, _FREE_PAGE_LEAF_MAGIC@GOTPAGE
Lloh1:
	ldr	x23, [x23, _FREE_PAGE_LEAF_MAGIC@GOTPAGEOFF]
	ldr	x9, [x23]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _FPM_ITEMS_PER_LEAF_PAGE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _FPM_ITEMS_PER_LEAF_PAGE@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:
Lloh4:
	adrp	x9, _FREE_PAGE_INTERNAL_MAGIC@GOTPAGE
Lloh5:
	ldr	x9, [x9, _FREE_PAGE_INTERNAL_MAGIC@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, eq
	bl	_Assert
Lloh7:
	adrp	x8, _FPM_ITEMS_PER_INTERNAL_PAGE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _FPM_ITEMS_PER_INTERNAL_PAGE@GOTPAGEOFF]
LBB0_3:
	ldrsw	x24, [x8]
	ldr	w8, [x20, #8]
	mov	w9, #21846
	movk	w9, #21845, lsl #16
	mul	x9, x24, x9
	lsr	x10, x9, #63
	lsr	x9, x9, #32
	add	w9, w9, w10
	cmp	w8, w9
	b.ge	LBB0_8
; %bb.4:
	mov	x0, x21
	mov	x1, x20
	bl	_FreePageBtreeFindRightSibling
	cbz	x0, LBB0_6
; %bb.5:
	mov	x22, x0
	ldrsw	x9, [x20, #8]
	ldr	w8, [x0, #8]
	add	w10, w8, w9
	cmp	w10, w24
	b.le	LBB0_9
LBB0_6:
	mov	x0, x21
	mov	x1, x20
	bl	_FreePageBtreeFindLeftSibling
	cbz	x0, LBB0_8
; %bb.7:
	mov	x22, x0
	ldr	w8, [x20, #8]
	ldrsw	x9, [x0, #8]
	add	w10, w9, w8
	cmp	w10, w24
	b.le	LBB0_11
LBB0_8:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_9:
	ldr	x10, [x20]
	ldr	x11, [x23]
	cmp	x10, x11
	b.ne	LBB0_13
; %bb.10:
	ldr	x10, [x20, #24]
	add	x0, x10, x9, lsl #2
	ldr	x1, [x22, #24]
	lsl	w2, w8, #2
	bl	_memcpy
	ldr	w8, [x22, #8]
	ldr	w9, [x20, #8]
	add	w8, w9, w8
	str	w8, [x20, #8]
	b	LBB0_16
LBB0_11:
	ldr	x10, [x20]
	ldr	x11, [x23]
	cmp	x10, x11
	b.ne	LBB0_14
; %bb.12:
	ldr	x10, [x22, #24]
	add	x0, x10, x9, lsl #2
	ldr	x1, [x20, #24]
	lsl	w2, w8, #2
	bl	_memcpy
	ldr	w8, [x20, #8]
	ldr	w9, [x22, #8]
	add	w8, w9, w8
	str	w8, [x22, #8]
	b	LBB0_15
LBB0_13:
	ldr	x10, [x20, #16]
	add	x0, x10, x9, lsl #2
	ldr	x1, [x22, #16]
	lsl	w2, w8, #2
	bl	_memcpy
	ldr	w8, [x22, #8]
	ldr	w9, [x20, #8]
	add	w8, w9, w8
	str	w8, [x20, #8]
	mov	x0, x21
	mov	x1, x20
	bl	_FreePageBtreeUpdateParentPointers
	b	LBB0_16
LBB0_14:
	ldr	x10, [x22, #16]
	add	x0, x10, x9, lsl #2
	ldr	x1, [x20, #16]
	lsl	w2, w8, #2
	bl	_memcpy
	ldr	w8, [x20, #8]
	ldr	w9, [x22, #8]
	add	w8, w9, w8
	str	w8, [x22, #8]
	mov	x0, x21
	mov	x1, x22
	bl	_FreePageBtreeUpdateParentPointers
LBB0_15:
	mov	x22, x20
LBB0_16:
	mov	x0, x19
	mov	x1, x22
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_FreePageBtreeRemovePage
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_FREE_PAGE_LEAF_MAGIC,8,3       ; @FREE_PAGE_LEAF_MAGIC
	.comm	_FPM_ITEMS_PER_LEAF_PAGE,4,2    ; @FPM_ITEMS_PER_LEAF_PAGE
	.comm	_FREE_PAGE_INTERNAL_MAGIC,8,3   ; @FREE_PAGE_INTERNAL_MAGIC
	.comm	_FPM_ITEMS_PER_INTERNAL_PAGE,4,2 ; @FPM_ITEMS_PER_INTERNAL_PAGE
	.no_dead_strip	_FreePageBtreeConsolidate
.subsections_via_symbols
