	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _bt_endpoint
__bt_endpoint:                          ## @_bt_endpoint
	.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	%rdi, %r15
	movl	28(%rdi), %r14d
	movslq	24(%rdi), %rbx
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	%rsi, %rdi
	callq	_ScanDirectionIsBackward
	movl	20(%r15), %ecx
	xorl	%r13d, %r13d
	movl	%r14d, %edi
	xorl	%esi, %esi
	movq	%rax, %rdx
	callq	__bt_get_endpoint
	movl	%eax, %r12d
	movl	%eax, %edi
	callq	_BufferIsValid
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movl	%r12d, %edi
	callq	_BufferGetBlockNumber
	movl	20(%r15), %edx
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_PredicateLockPage
	movl	%r12d, %edi
	callq	_BufferGetPage
	movl	%eax, %r13d
	movl	%eax, %edi
	callq	_PageGetSpecialPointer
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_P_ISLEAF
	movl	%eax, %edi
	callq	_Assert
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_ScanDirectionIsForward
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:
	movq	%r14, %rdi
	callq	_P_FIRSTDATAKEY
	jmp	LBB0_4
LBB0_1:
	movl	20(%r15), %esi
	movl	%r14d, %edi
	callq	_PredicateLockRelation
	movq	24(%rbx), %rax
	movq	%rax, 16(%rsp)
	movups	8(%rbx), %xmm0
	movups	%xmm0, (%rsp)
	callq	_BTScanPosInvalidate
	jmp	LBB0_14
LBB0_5:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_ScanDirectionIsBackward
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	%r14, %rdi
	callq	_P_RIGHTMOST
	movl	%eax, %edi
	callq	_Assert
	movl	%r13d, %edi
	callq	_PageGetMaxOffsetNumber
LBB0_4:
	movq	%rax, %r14
	movq	-48(%rbp), %r13                 ## 8-byte Reload
LBB0_8:
	movl	%r12d, 24(%rbx)
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	__bt_initialize_more_data
	movq	%r15, %rdi
	movq	%r13, %rsi
	movq	%r14, %rdx
	callq	__bt_readpage
	testl	%eax, %eax
	je	LBB0_9
## %bb.11:
	leaq	8(%rbx), %rsi
	movq	%r15, %rdi
	callq	__bt_drop_lock_and_maybe_pin
	jmp	LBB0_12
LBB0_9:
	movl	24(%rbx), %edi
	movq	_BUFFER_LOCK_UNLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_LockBuffer
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	__bt_steppage
	testl	%eax, %eax
	je	LBB0_10
LBB0_12:
	movq	8(%rbx), %rax
	movq	16(%rbx), %rcx
	shlq	$4, %rax
	movl	8(%rcx,%rax), %edx
	movl	%edx, 16(%r15)
	movl	$1, %r13d
	cmpq	$0, 8(%r15)
	je	LBB0_14
## %bb.13:
	movq	(%rcx,%rax), %rax
	addq	(%rbx), %rax
	movq	%rax, (%r15)
	jmp	LBB0_14
LBB0_7:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	movl	%r13d, %edx
	callq	_elog
	xorl	%r14d, %r14d
	jmp	LBB0_8
LBB0_10:
	xorl	%r13d, %r13d
LBB0_14:
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ERROR,4,2                      ## @ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid scan direction: %d"

	.comm	_BUFFER_LOCK_UNLOCK,4,2         ## @BUFFER_LOCK_UNLOCK
	.no_dead_strip	__bt_endpoint
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _bt_endpoint
__bt_endpoint:                          ; @_bt_endpoint
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x21, x1
	mov	x20, x0
	ldp	w19, w23, [x0, #24]
                                        ; kill: def $w19 killed $w19 def $x19
	sxtw	x19, w19
	mov	x0, x1
	bl	_ScanDirectionIsBackward
	mov	x2, x0
	ldr	w3, [x20, #20]
	mov	x0, x23
	mov	w1, #0
	bl	__bt_get_endpoint
	mov	x22, x0
	bl	_BufferIsValid
	cbz	w0, LBB0_3
; %bb.1:
	mov	x0, x22
	bl	_BufferGetBlockNumber
	mov	x1, x0
	ldr	w2, [x20, #20]
	mov	x0, x23
	bl	_PredicateLockPage
	mov	x0, x22
	bl	_BufferGetPage
	mov	x23, x0
	bl	_PageGetSpecialPointer
	mov	x24, x0
	bl	_P_ISLEAF
	bl	_Assert
	mov	x0, x21
	bl	_ScanDirectionIsForward
	cbz	x0, LBB0_4
; %bb.2:
	mov	x0, x24
	bl	_P_FIRSTDATAKEY
	mov	x23, x0
	b	LBB0_7
LBB0_3:
	ldr	w1, [x20, #20]
	mov	x0, x23
	bl	_PredicateLockRelation
	ldur	q0, [x19, #8]
	ldr	x8, [x19, #24]
	str	x8, [sp, #16]
	str	q0, [sp]
	mov	x0, sp
	bl	_BTScanPosInvalidate
	mov	w0, #0
	b	LBB0_13
LBB0_4:
	mov	x0, x21
	bl	_ScanDirectionIsBackward
	cbz	x0, LBB0_6
; %bb.5:
	mov	x0, x24
	bl	_P_RIGHTMOST
	bl	_Assert
	mov	x0, x23
	bl	_PageGetMaxOffsetNumber
	mov	x23, x0
	b	LBB0_7
LBB0_6:
Lloh0:
	adrp	x8, _ERROR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	bl	_elog
	mov	x23, #0
LBB0_7:
	str	w22, [x19, #24]
	mov	x0, x19
	mov	x1, x21
	bl	__bt_initialize_more_data
	mov	x0, x20
	mov	x1, x21
	mov	x2, x23
	bl	__bt_readpage
	cbz	w0, LBB0_9
; %bb.8:
	add	x1, x19, #8
	mov	x0, x20
	bl	__bt_drop_lock_and_maybe_pin
	b	LBB0_10
LBB0_9:
	ldr	w0, [x19, #24]
Lloh5:
	adrp	x8, _BUFFER_LOCK_UNLOCK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _BUFFER_LOCK_UNLOCK@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	bl	_LockBuffer
	mov	x0, x20
	mov	x1, x21
	bl	__bt_steppage
	cbz	w0, LBB0_13
LBB0_10:
	ldp	x9, x8, [x19, #8]
	add	x10, x8, x9, lsl #4
	ldr	w10, [x10, #8]
	str	w10, [x20, #16]
	ldr	x10, [x20, #8]
	cbz	x10, LBB0_12
; %bb.11:
	ldr	x10, [x19]
	lsl	x9, x9, #4
	ldr	x8, [x8, x9]
	add	x8, x8, x10
	str	x8, [x20]
LBB0_12:
	mov	w0, #1
LBB0_13:
	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
	add	sp, sp, #96
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_ERROR,4,2                      ; @ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid scan direction: %d"

	.comm	_BUFFER_LOCK_UNLOCK,4,2         ; @BUFFER_LOCK_UNLOCK
	.no_dead_strip	__bt_endpoint
.subsections_via_symbols
