	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ginScanToDelete
_ginScanToDelete:                       ## @ginScanToDelete
	.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
	movq	%rcx, %r14
	movl	%edx, %r15d
	movq	%rsi, %rbx
	movq	%rdi, %r12
	testl	%edx, %edx
	movq	%r8, -72(%rbp)                  ## 8-byte Spill
	je	LBB0_2
## %bb.1:
	movq	%r14, %r13
	jmp	LBB0_4
LBB0_2:
	movq	32(%r14), %r13
	testq	%r13, %r13
	jne	LBB0_4
## %bb.3:
	movl	$40, %edi
	callq	_palloc0
	movq	%rax, %r13
	movq	%r14, 16(%rax)
	movq	%rax, 32(%r14)
	movq	_InvalidBlockNumber@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r13)
LBB0_4:
	movl	(%r12), %r8d
	movl	4(%r12), %edi
	movq	_MAIN_FORKNUM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_RBM_NORMAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdx
	callq	_ReadBufferExtended
	movl	%eax, %ebx
	movl	%r15d, -48(%rbp)                ## 4-byte Spill
	testl	%r15d, %r15d
	jne	LBB0_6
## %bb.5:
	movq	_GIN_EXCLUSIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	callq	_LockBuffer
LBB0_6:
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movl	%ebx, %edi
	callq	_BufferGetPage
	movl	%eax, %r14d
	movl	%eax, %edi
	callq	_GinPageIsData
	movl	%eax, %edi
	callq	_Assert
	movl	%r14d, %edi
	callq	_GinPageIsLeaf
	testq	%rax, %rax
	je	LBB0_7
LBB0_10:
	movl	%r14d, %edi
	callq	_GinPageIsLeaf
	movl	%r14d, %edi
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	callq	_GinDataLeafPageIsEmpty
	jmp	LBB0_13
LBB0_7:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 24(%r13)
	movq	_FirstOffsetNumber@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r14d, %edi
	callq	_GinPageGetOpaque
	cmpq	(%rax), %rbx
	jg	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_9 Depth=1
	movl	%r14d, %edi
	movq	%rbx, %rsi
	callq	_GinDataPageGetPostingItem
	movq	%rax, %rdi
	callq	_PostingItemGetBlockNumber
	movq	%r12, %rdi
	movq	%rax, %rsi
	xorl	%edx, %edx
	movq	%r13, %rcx
	movq	%rbx, %r8
	callq	_ginScanToDelete
	cmpl	$1, %eax
	adcq	$-1, %rbx
	incq	%rbx
	jmp	LBB0_9
LBB0_12:
	callq	_GinPageGetOpaque
	movq	(%rax), %rcx
	movq	_FirstOffsetNumber@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	cmpq	(%rdx), %rcx
	setl	%al
LBB0_13:
	movb	$1, %r15b
	testl	%eax, %eax
	je	LBB0_14
## %bb.15:
	movl	$0, -52(%rbp)                   ## 4-byte Folded Spill
	movq	(%r13), %rax
	movq	_InvalidBlockNumber@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_16
## %bb.17:
	movl	%r14d, %edi
	callq	_GinPageRightMost
	testl	%eax, %eax
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	jne	LBB0_19
## %bb.18:
	xorl	%edi, %edi
	testl	%ebx, %ebx
	sete	%dil
	callq	_Assert
	movq	(%r13), %rdx
	movq	16(%r13), %rax
	movq	24(%rax), %rcx
	movl	8(%rax), %r9d
	movq	%r12, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movq	-72(%rbp), %r8                  ## 8-byte Reload
	callq	_ginDeletePage
	movl	$1, -52(%rbp)                   ## 4-byte Folded Spill
	xorl	%r15d, %r15d
	jmp	LBB0_19
LBB0_14:
	movl	$0, -52(%rbp)                   ## 4-byte Folded Spill
LBB0_16:
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	movl	-44(%rbp), %r14d                ## 4-byte Reload
LBB0_19:
	testl	%ebx, %ebx
	jne	LBB0_21
## %bb.20:
	movq	_GIN_UNLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edi
	callq	_LockBuffer
LBB0_21:
	movl	%r14d, %edi
	callq	_ReleaseBuffer
	testb	%r15b, %r15b
	je	LBB0_23
## %bb.22:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, (%r13)
LBB0_23:
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_InvalidBlockNumber,8,3         ## @InvalidBlockNumber
	.comm	_MAIN_FORKNUM,4,2               ## @MAIN_FORKNUM
	.comm	_RBM_NORMAL,4,2                 ## @RBM_NORMAL
	.comm	_GIN_EXCLUSIVE,4,2              ## @GIN_EXCLUSIVE
	.comm	_FirstOffsetNumber,8,3          ## @FirstOffsetNumber
	.comm	_GIN_UNLOCK,4,2                 ## @GIN_UNLOCK
	.no_dead_strip	_ginScanToDelete
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ginScanToDelete
_ginScanToDelete:                       ; @ginScanToDelete
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x23, x4
	mov	x22, x3
	mov	x21, x2
	mov	x19, x1
	mov	x24, x0
	cbz	w2, LBB0_2
; %bb.1:
	mov	x20, x22
	b	LBB0_4
LBB0_2:
	ldr	x20, [x22, #32]
	cbnz	x20, LBB0_4
; %bb.3:
	mov	w0, #40
	bl	_palloc0
	mov	x20, x0
	str	x22, [x0, #16]
	str	x0, [x22, #32]
Lloh0:
	adrp	x8, _InvalidBlockNumber@GOTPAGE
Lloh1:
	ldr	x8, [x8, _InvalidBlockNumber@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [x0]
LBB0_4:
Lloh3:
	adrp	x8, _MAIN_FORKNUM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAIN_FORKNUM@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x8, _RBM_NORMAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _RBM_NORMAL@GOTPAGEOFF]
Lloh8:
	ldr	w3, [x8]
	ldp	w4, w0, [x24]
	mov	x2, x19
	bl	_ReadBufferExtended
	mov	x22, x0
	cbnz	w21, LBB0_6
; %bb.5:
Lloh9:
	adrp	x8, _GIN_EXCLUSIVE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _GIN_EXCLUSIVE@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_LockBuffer
LBB0_6:
	mov	x0, x22
	bl	_BufferGetPage
	mov	x25, x0
	bl	_GinPageIsData
	bl	_Assert
	mov	x0, x25
	bl	_GinPageIsLeaf
	cbz	x0, LBB0_9
LBB0_7:
	mov	x0, x25
	bl	_GinPageIsLeaf
	cbz	x0, LBB0_12
; %bb.8:
	mov	x0, x25
	bl	_GinDataLeafPageIsEmpty
	cbnz	w0, LBB0_13
	b	LBB0_15
LBB0_9:
	str	x19, [x20, #24]
Lloh12:
	adrp	x8, _FirstOffsetNumber@GOTPAGE
Lloh13:
	ldr	x8, [x8, _FirstOffsetNumber@GOTPAGEOFF]
Lloh14:
	ldr	x26, [x8]
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x25
	bl	_GinPageGetOpaque
	ldr	x8, [x0]
	cmp	x26, x8
	b.gt	LBB0_7
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x0, x25
	mov	x1, x26
	bl	_GinDataPageGetPostingItem
	bl	_PostingItemGetBlockNumber
	mov	x1, x0
	mov	x0, x24
	mov	w2, #0
	mov	x3, x20
	mov	x4, x26
	bl	_ginScanToDelete
	cmp	w0, #0
	cset	w8, ne
	sub	x8, x26, x8
	add	x26, x8, #1
	b	LBB0_10
LBB0_12:
	mov	x0, x25
	bl	_GinPageGetOpaque
	ldr	x8, [x0]
Lloh15:
	adrp	x9, _FirstOffsetNumber@GOTPAGE
Lloh16:
	ldr	x9, [x9, _FirstOffsetNumber@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, lt
	cbz	w0, LBB0_15
LBB0_13:
	ldr	x8, [x20]
Lloh18:
	adrp	x9, _InvalidBlockNumber@GOTPAGE
Lloh19:
	ldr	x9, [x9, _InvalidBlockNumber@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_15
; %bb.14:
	mov	x0, x25
	bl	_GinPageRightMost
	cbz	w0, LBB0_20
LBB0_15:
	mov	w23, #0
	mov	w24, #1
	cbnz	w21, LBB0_17
LBB0_16:
Lloh21:
	adrp	x8, _GIN_UNLOCK@GOTPAGE
Lloh22:
	ldr	x8, [x8, _GIN_UNLOCK@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_LockBuffer
LBB0_17:
	mov	x0, x22
	bl	_ReleaseBuffer
	cbz	w24, LBB0_19
; %bb.18:
	str	x19, [x20]
LBB0_19:
	mov	x0, x23
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_20:
	cmp	w21, #0
	cset	w0, eq
	bl	_Assert
	ldr	x2, [x20]
	ldr	x8, [x20, #16]
	ldr	x3, [x8, #24]
	ldr	w5, [x8, #8]
	mov	x0, x24
	mov	x1, x19
	mov	x4, x23
	bl	_ginDeletePage
	mov	w24, #0
	mov	w23, #1
	cbnz	w21, LBB0_17
	b	LBB0_16
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_InvalidBlockNumber,8,3         ; @InvalidBlockNumber
	.comm	_MAIN_FORKNUM,4,2               ; @MAIN_FORKNUM
	.comm	_RBM_NORMAL,4,2                 ; @RBM_NORMAL
	.comm	_GIN_EXCLUSIVE,4,2              ; @GIN_EXCLUSIVE
	.comm	_FirstOffsetNumber,8,3          ; @FirstOffsetNumber
	.comm	_GIN_UNLOCK,4,2                 ; @GIN_UNLOCK
	.no_dead_strip	_ginScanToDelete
.subsections_via_symbols
