	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fsm_search_avail               ## -- Begin function fsm_search_avail
	.p2align	4, 0x90
_fsm_search_avail:                      ## @fsm_search_avail
	.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	%ecx, -56(%rbp)                 ## 4-byte Spill
	movl	%edx, %r12d
	movq	%rsi, %rbx
	movl	%edi, %r15d
	callq	_BufferGetPage
	movl	%eax, %r13d
	movl	%eax, %edi
	callq	_PageGetContents
	movslq	%eax, %r14
	movq	(%r14), %rcx
	movl	$-1, %eax
	cmpq	%rbx, (%rcx)
	jl	LBB0_16
## %bb.1:
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movl	-56(%rbp), %r15d                ## 4-byte Reload
	movl	%r13d, -52(%rbp)                ## 4-byte Spill
	movl	%r12d, -48(%rbp)                ## 4-byte Spill
	movq	_LeafNodesPerPage@GOTPCREL(%rip), %rax
	xorl	%esi, %esi
	movq	_NonLeafNodesPerPage@GOTPCREL(%rip), %r12
	movq	_NodesPerPage@GOTPCREL(%rip), %r13
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_3 Depth 2
                                        ##     Child Loop BB0_6 Depth 2
	movl	8(%r14), %edx
	cmpl	(%rax), %edx
	movl	$0, %eax
	cmovll	%edx, %eax
	testl	%edx, %edx
	cmovsl	%esi, %eax
	addl	(%r12), %eax
	jle	LBB0_6
	.p2align	4, 0x90
LBB0_3:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%eax, %edx
	cmpq	%rbx, (%rcx,%rdx,8)
	jge	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=2
	movl	%eax, %edi
	callq	_rightneighbor
	movl	%eax, %edi
	callq	_parentof
	testl	%eax, %eax
	jle	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=2
	movq	(%r14), %rcx
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_6:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r12), %ecx
	cmpl	%ecx, %eax
	jge	LBB0_15
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=2
	movl	%eax, %edi
	callq	_leftchild
	movl	(%r13), %ecx
	cmpl	%ecx, %eax
	jge	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=2
	movq	(%r14), %rdx
	movslq	%eax, %rsi
	cmpq	%rbx, (%rdx,%rsi,8)
	jge	LBB0_6
LBB0_9:                                 ##   in Loop: Header=BB0_6 Depth=2
	incl	%eax
	cmpl	%ecx, %eax
	jge	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_6 Depth=2
	movq	(%r14), %rcx
	movslq	%eax, %rdx
	cmpq	%rbx, (%rcx,%rdx,8)
	jge	LBB0_6
LBB0_11:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	leaq	-72(%rbp), %rsi
	leaq	-76(%rbp), %rdx
	leaq	-60(%rbp), %rcx
	callq	_BufferGetTag
	movq	_DEBUG1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	-60(%rbp), %edx
	movl	-64(%rbp), %ecx
	movl	-72(%rbp), %r9d
	movl	-68(%rbp), %r8d
	leaq	L_.str(%rip), %rsi
	callq	_elog
	testl	%r15d, %r15d
	jne	LBB0_12
## %bb.14:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	_BUFFER_LOCK_UNLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	movl	%r15d, %edi
	callq	_LockBuffer
	movq	_BUFFER_LOCK_EXCLUSIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edi
	callq	_LockBuffer
	movl	$1, %r15d
LBB0_12:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	callq	_fsm_rebuild_page
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	xorl	%esi, %esi
	callq	_MarkBufferDirtyHint
	movq	(%r14), %rcx
	cmpq	%rbx, (%rcx)
	movq	_LeafNodesPerPage@GOTPCREL(%rip), %rax
	movl	$0, %esi
	jge	LBB0_2
## %bb.13:
	movl	$-1, %eax
	jmp	LBB0_16
LBB0_15:
	subl	%ecx, %eax
	cmpl	$1, -48(%rbp)                   ## 4-byte Folded Reload
	movl	%eax, %ecx
	sbbl	$-1, %ecx
	movl	%ecx, 8(%r14)
LBB0_16:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LeafNodesPerPage,4,2           ## @LeafNodesPerPage
	.comm	_NonLeafNodesPerPage,4,2        ## @NonLeafNodesPerPage
	.comm	_NodesPerPage,4,2               ## @NodesPerPage
	.comm	_DEBUG1,4,2                     ## @DEBUG1
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"fixing corrupt FSM block %u, relation %u/%u/%u"

	.comm	_BUFFER_LOCK_UNLOCK,4,2         ## @BUFFER_LOCK_UNLOCK
	.comm	_BUFFER_LOCK_EXCLUSIVE,4,2      ## @BUFFER_LOCK_EXCLUSIVE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fsm_search_avail               ; -- Begin function fsm_search_avail
	.p2align	2
_fsm_search_avail:                      ; @fsm_search_avail
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x24, x3
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	bl	_BufferGetPage
	mov	x23, x0
	bl	_PageGetContents
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x26, w0
	ldr	x8, [x26]
	ldr	x9, [x8]
	mov	w22, #-1
	cmp	x9, x20
	b.lt	LBB0_16
; %bb.1:
Lloh0:
	adrp	x27, _LeafNodesPerPage@GOTPAGE
Lloh1:
	ldr	x27, [x27, _LeafNodesPerPage@GOTPAGEOFF]
Lloh2:
	adrp	x28, _NonLeafNodesPerPage@GOTPAGE
Lloh3:
	ldr	x28, [x28, _NonLeafNodesPerPage@GOTPAGEOFF]
Lloh4:
	adrp	x25, _NodesPerPage@GOTPAGE
Lloh5:
	ldr	x25, [x25, _NodesPerPage@GOTPAGEOFF]
LBB0_2:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_3 Depth 2
                                        ;     Child Loop BB0_6 Depth 2
	ldr	w9, [x26, #8]
	ldr	w10, [x27]
	cmp	w9, w10
	ccmp	w9, w22, #4, lt
	csel	w9, w9, wzr, gt
	ldr	w10, [x28]
	add	w0, w9, w10
	cmp	w0, #1
	b.lt	LBB0_6
LBB0_3:                                 ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x8, w0, uxtw #3]
	cmp	x8, x20
	b.ge	LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=2
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_rightneighbor
	bl	_parentof
                                        ; kill: def $w0 killed $w0 def $x0
	cmp	w0, #1
	b.lt	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=2
	ldr	x8, [x26]
	b	LBB0_3
LBB0_6:                                 ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w8, [x28]
	cmp	w0, w8
	b.ge	LBB0_15
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=2
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_leftchild
	mov	x8, x0
	ldr	w9, [x25]
	cmp	w0, w9
	b.ge	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=2
	ldr	x10, [x26]
	ldr	x10, [x10, w8, sxtw #3]
	mov	x0, x8
	cmp	x10, x20
	b.ge	LBB0_6
LBB0_9:                                 ;   in Loop: Header=BB0_6 Depth=2
	sxtw	x8, w8
	add	x0, x8, #1
	cmp	w0, w9
	b.ge	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=2
	ldr	x8, [x26]
	ldr	x8, [x8, x0, lsl #3]
	cmp	x8, x20
	b.ge	LBB0_6
LBB0_11:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x1, sp, #16
	add	x2, sp, #12
	add	x3, sp, #8
	mov	x0, x21
	bl	_BufferGetTag
Lloh6:
	adrp	x8, _DEBUG1@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DEBUG1@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	ldr	w2, [sp, #8]
	ldp	w4, w3, [sp, #20]
	ldr	w5, [sp, #16]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	bl	_elog
	cbnz	w24, LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_2 Depth=1
Lloh11:
	adrp	x8, _BUFFER_LOCK_UNLOCK@GOTPAGE
Lloh12:
	ldr	x8, [x8, _BUFFER_LOCK_UNLOCK@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_LockBuffer
Lloh14:
	adrp	x8, _BUFFER_LOCK_EXCLUSIVE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _BUFFER_LOCK_EXCLUSIVE@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_LockBuffer
	mov	w24, #1
LBB0_13:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x23
	bl	_fsm_rebuild_page
	mov	x0, x21
	mov	w1, #0
	bl	_MarkBufferDirtyHint
	ldr	x8, [x26]
	ldr	x9, [x8]
	cmp	x9, x20
	b.ge	LBB0_2
; %bb.14:
	mov	w22, #-1
	b	LBB0_16
LBB0_15:
	sub	w22, w0, w8
	cmp	w19, #0
	cinc	w8, w22, ne
	str	w8, [x26, #8]
LBB0_16:
	mov	x0, x22
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_LeafNodesPerPage,4,2           ; @LeafNodesPerPage
	.comm	_NonLeafNodesPerPage,4,2        ; @NonLeafNodesPerPage
	.comm	_NodesPerPage,4,2               ; @NodesPerPage
	.comm	_DEBUG1,4,2                     ; @DEBUG1
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"fixing corrupt FSM block %u, relation %u/%u/%u"

	.comm	_BUFFER_LOCK_UNLOCK,4,2         ; @BUFFER_LOCK_UNLOCK
	.comm	_BUFFER_LOCK_EXCLUSIVE,4,2      ; @BUFFER_LOCK_EXCLUSIVE
.subsections_via_symbols
