	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_SpGistGetBuffer                ## -- Begin function SpGistGetBuffer
	.p2align	4, 0x90
_SpGistGetBuffer:                       ## @SpGistGetBuffer
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movl	%edx, %ebx
	movl	%esi, %r15d
	movl	%edi, %r14d
	callq	_spgGetCache
	movq	%rax, %r13
	movq	_SPGIST_PAGE_CAPACITY@GOTPCREL(%rip), %r12
	cmpl	%ebx, (%r12)
	jge	LBB0_2
## %bb.1:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_elog
LBB0_2:
	movq	_SPGIST_DEFAULT_FILLFACTOR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edi
	callq	_RelationGetTargetPageFreeSpace
	addl	%eax, %ebx
	movl	(%r12), %esi
	movl	%ebx, %edi
	callq	_Min
	movl	%eax, %ebx
	movq	%r13, %rdi
	movl	%r15d, %esi
	callq	_GET_LUP
	movq	%rax, %r13
	movq	(%rax), %rdi
	movq	_InvalidBlockNumber@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdi
	je	LBB0_6
## %bb.3:
	callq	_SpGistBlockIsFixed
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_Assert
	cmpl	%ebx, 8(%r13)
	jl	LBB0_6
## %bb.4:
	movq	(%r13), %rsi
	movl	%r14d, %edi
	callq	_ReadBuffer
	movl	%eax, %r12d
	movl	%eax, %edi
	callq	_ConditionalLockBuffer
	testl	%eax, %eax
	je	LBB0_5
## %bb.7:
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
	movl	%r12d, %edi
	callq	_BufferGetPage
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_PageIsNew
	testq	%rax, %rax
	movl	%r12d, -52(%rbp)                ## 4-byte Spill
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	jne	LBB0_10
## %bb.8:
	movl	%ebx, %edi
	callq	_SpGistPageIsDeleted
	testq	%rax, %rax
	jne	LBB0_10
## %bb.9:
	movl	%ebx, %edi
	callq	_PageIsEmpty
	testq	%rax, %rax
	je	LBB0_15
LBB0_10:
	movl	%r15d, %edi
	callq	_GBUF_REQ_LEAF
	xorl	%ebx, %ebx
	movl	$0, %r14d
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	movq	_SPGIST_LEAF@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
LBB0_12:
	movl	%r15d, %edi
	callq	_GBUF_REQ_NULLS
	testq	%rax, %rax
	movl	-48(%rbp), %r15d                ## 4-byte Reload
	je	LBB0_14
## %bb.13:
	movq	_SPGIST_NULLS@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_14:
	orl	%r14d, %ebx
	movl	-52(%rbp), %r14d                ## 4-byte Reload
	movl	%r14d, %edi
	movl	%ebx, %esi
	callq	_SpGistInitBuffer
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_PageGetExactFreeSpace
	subl	%r15d, %eax
	movl	%eax, 8(%r13)
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	$1, (%rax)
LBB0_24:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	%r12d, %edi
	callq	_ReleaseBuffer
LBB0_6:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	$1, (%rax)
	movl	%r14d, %edi
	movl	%r15d, %esi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_allocNewBuffer                 ## TAILCALL
LBB0_15:
	movl	%r15d, %edi
	callq	_GBUF_REQ_LEAF
	movq	%rax, %r12
	movl	%ebx, %edi
	callq	_SpGistPageIsLeaf
	testq	%r12, %r12
	je	LBB0_18
## %bb.16:
	testl	%eax, %eax
	movl	-48(%rbp), %r12d                ## 4-byte Reload
	jne	LBB0_19
	jmp	LBB0_17
LBB0_18:
	testl	%eax, %eax
	movl	-48(%rbp), %r12d                ## 4-byte Reload
	jne	LBB0_17
LBB0_19:
	movl	%r15d, %edi
	callq	_GBUF_REQ_NULLS
	movq	%rax, %rbx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_SpGistPageStoresNulls
	testq	%rbx, %rbx
	je	LBB0_21
## %bb.20:
	testl	%eax, %eax
	jne	LBB0_22
	jmp	LBB0_17
LBB0_21:
	testl	%eax, %eax
	jne	LBB0_17
LBB0_22:
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_PageGetExactFreeSpace
	subl	%r12d, %eax
	jge	LBB0_23
LBB0_17:
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	callq	_UnlockReleaseBuffer
	jmp	LBB0_6
LBB0_23:
	movl	%eax, 8(%r13)
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	$0, (%rax)
	movl	-52(%rbp), %r14d                ## 4-byte Reload
	jmp	LBB0_24
	.cfi_endproc
                                        ## -- End function
	.comm	_SPGIST_PAGE_CAPACITY,4,2       ## @SPGIST_PAGE_CAPACITY
	.comm	_ERROR,4,2                      ## @ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"desired SPGiST tuple size is too big"

	.comm	_SPGIST_DEFAULT_FILLFACTOR,4,2  ## @SPGIST_DEFAULT_FILLFACTOR
	.comm	_InvalidBlockNumber,8,3         ## @InvalidBlockNumber
	.comm	_SPGIST_LEAF,4,2                ## @SPGIST_LEAF
	.comm	_SPGIST_NULLS,4,2               ## @SPGIST_NULLS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_SpGistGetBuffer                ; -- Begin function SpGistGetBuffer
	.p2align	2
_SpGistGetBuffer:                       ; @SpGistGetBuffer
	.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	x19, x3
	mov	x22, x2
	mov	x20, x1
	mov	x21, x0
	bl	_spgGetCache
	mov	x23, x0
Lloh0:
	adrp	x24, _SPGIST_PAGE_CAPACITY@GOTPAGE
Lloh1:
	ldr	x24, [x24, _SPGIST_PAGE_CAPACITY@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w8, w22
	b.ge	LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _ERROR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	bl	_elog
LBB0_2:
Lloh7:
	adrp	x8, _SPGIST_DEFAULT_FILLFACTOR@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SPGIST_DEFAULT_FILLFACTOR@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_RelationGetTargetPageFreeSpace
	add	w0, w0, w22
	ldr	w1, [x24]
	bl	_Min
	mov	x22, x0
	mov	x0, x23
	mov	x1, x20
	bl	_GET_LUP
	mov	x23, x0
	ldr	x0, [x0]
Lloh10:
	adrp	x8, _InvalidBlockNumber@GOTPAGE
Lloh11:
	ldr	x8, [x8, _InvalidBlockNumber@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	cmp	x0, x8
	b.eq	LBB0_11
; %bb.3:
	bl	_SpGistBlockIsFixed
	cmp	w0, #0
	cset	w0, eq
	bl	_Assert
	ldr	w8, [x23, #8]
	cmp	w8, w22
	b.lt	LBB0_11
; %bb.4:
	ldr	x1, [x23]
	mov	x0, x21
	bl	_ReadBuffer
	mov	x24, x0
	bl	_ConditionalLockBuffer
	cbz	w0, LBB0_10
; %bb.5:
	mov	x0, x24
	bl	_BufferGetPage
	mov	x25, x0
	bl	_PageIsNew
	cbnz	x0, LBB0_8
; %bb.6:
	mov	x0, x25
	bl	_SpGistPageIsDeleted
	cbnz	x0, LBB0_8
; %bb.7:
	mov	x0, x25
	bl	_PageIsEmpty
	cbz	x0, LBB0_12
LBB0_8:
	mov	x0, x20
	bl	_GBUF_REQ_LEAF
Lloh13:
	adrp	x8, _SPGIST_LEAF@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SPGIST_LEAF@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	cmp	x0, #0
	csel	w21, wzr, w8, eq
	mov	x0, x20
	bl	_GBUF_REQ_NULLS
Lloh16:
	adrp	x8, _SPGIST_NULLS@GOTPAGE
Lloh17:
	ldr	x8, [x8, _SPGIST_NULLS@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	cmp	x0, #0
	csel	w8, wzr, w8, eq
	orr	w1, w8, w21
	mov	x0, x24
	bl	_SpGistInitBuffer
	mov	x0, x25
	bl	_PageGetExactFreeSpace
	sub	w8, w0, w22
	str	w8, [x23, #8]
	mov	w8, #1
	str	w8, [x19]
LBB0_9:
	mov	x0, x24
	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_10:
	mov	x0, x24
	bl	_ReleaseBuffer
LBB0_11:
	mov	w8, #1
	str	w8, [x19]
	mov	x0, x21
	mov	x1, x20
	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
	b	_allocNewBuffer
LBB0_12:
	mov	x0, x20
	bl	_GBUF_REQ_LEAF
	mov	x26, x0
	mov	x0, x25
	bl	_SpGistPageIsLeaf
	cbz	x26, LBB0_14
; %bb.13:
	cbnz	w0, LBB0_15
	b	LBB0_19
LBB0_14:
	cbnz	w0, LBB0_19
LBB0_15:
	mov	x0, x20
	bl	_GBUF_REQ_NULLS
	mov	x26, x0
	mov	x0, x25
	bl	_SpGistPageStoresNulls
	cbz	x26, LBB0_17
; %bb.16:
	cbnz	w0, LBB0_18
	b	LBB0_19
LBB0_17:
	cbnz	w0, LBB0_19
LBB0_18:
	mov	x0, x25
	bl	_PageGetExactFreeSpace
	subs	w8, w0, w22
	b.ge	LBB0_20
LBB0_19:
	mov	x0, x24
	bl	_UnlockReleaseBuffer
	b	LBB0_11
LBB0_20:
	str	w8, [x23, #8]
	str	wzr, [x19]
	b	LBB0_9
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_SPGIST_PAGE_CAPACITY,4,2       ; @SPGIST_PAGE_CAPACITY
	.comm	_ERROR,4,2                      ; @ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"desired SPGiST tuple size is too big"

	.comm	_SPGIST_DEFAULT_FILLFACTOR,4,2  ; @SPGIST_DEFAULT_FILLFACTOR
	.comm	_InvalidBlockNumber,8,3         ; @InvalidBlockNumber
	.comm	_SPGIST_LEAF,4,2                ; @SPGIST_LEAF
	.comm	_SPGIST_NULLS,4,2               ; @SPGIST_NULLS
.subsections_via_symbols
