	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_SpGistPageAddNewItem           ## -- Begin function SpGistPageAddNewItem
	.p2align	4, 0x90
_SpGistPageAddNewItem:                  ## @SpGistPageAddNewItem
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, -60(%rbp)                 ## 4-byte Spill
	movq	%r8, -56(%rbp)                  ## 8-byte Spill
	movq	%rcx, %rbx
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movl	%esi, %r12d
	movl	%esi, %edi
	callq	_SpGistPageGetOpaque
	cmpq	$0, (%rax)
	jle	LBB0_21
## %bb.1:
	movq	%rax, %r15
	movl	%r12d, %edi
	callq	_PageGetExactFreeSpace
	movq	%rax, %r14
	movq	_SGDTSIZE@GOTPCREL(%rip), %rax
	addq	(%rax), %r14
	movq	%rbx, %rdi
	callq	_MAXALIGN
	cmpq	%rax, %r14
	jl	LBB0_21
## %bb.2:
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, -88(%rbp)                 ## 8-byte Spill
	movl	%r12d, %edi
	callq	_PageGetMaxOffsetNumber
	movq	_InvalidOffsetNumber@GOTPCREL(%rip), %rdx
	movq	(%rdx), %r14
	leaq	1(%rax), %r15
	movq	_SPGIST_PLACEHOLDER@GOTPCREL(%rip), %rbx
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	testq	%rcx, %rcx
	je	LBB0_5
	.p2align	4, 0x90
LBB0_4:
	movq	(%rcx), %r13
	cmpq	(%rdx), %r13
	jne	LBB0_6
LBB0_5:
	movq	_FirstOffsetNumber@GOTPCREL(%rip), %rsi
	movq	(%rsi), %r13
LBB0_6:
	cmpq	%rax, %r13
	jg	LBB0_11
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r12d, %edi
	movq	%r13, %rsi
	callq	_PageGetItemId
	movl	%r12d, %edi
	movl	%eax, %esi
	callq	_PageGetItem
	cltq
	movq	(%rax), %rax
	cmpq	(%rbx), %rax
	je	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	incq	%r13
	cmpq	%r13, %r15
	jne	LBB0_7
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_8:
	movq	%r13, %r14
LBB0_10:
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	_InvalidOffsetNumber@GOTPCREL(%rip), %rdx
	movq	-80(%rbp), %rax                 ## 8-byte Reload
LBB0_11:
	movq	(%rdx), %rsi
	cmpq	%rsi, %r14
	jne	LBB0_16
## %bb.12:
	testq	%rcx, %rcx
	je	LBB0_15
## %bb.13:
	cmpq	%r14, (%rcx)
	je	LBB0_15
## %bb.14:
	movq	%r14, (%rcx)
	testq	%rcx, %rcx
	jne	LBB0_4
	jmp	LBB0_5
LBB0_15:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	$0, (%rax)
	movq	(%rdx), %rsi
LBB0_16:
	cmpq	%rsi, %r14
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	jne	LBB0_17
LBB0_21:
	movq	_InvalidOffsetNumber@GOTPCREL(%rip), %r13
	movq	(%r13), %rcx
	movl	%r12d, %edi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movq	%rbx, %r14
	movq	%rbx, %rdx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_PageAddItem
	movq	%rax, %r15
	cmpl	$0, -60(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_25
## %bb.22:
	cmpq	(%r13), %r15
	jne	LBB0_25
## %bb.23:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edx
LBB0_24:
	callq	_elog
LBB0_25:
	movq	%r15, %rax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	movl	%r12d, %edi
	movq	%r14, %rsi
	movq	%rdx, %r13
	callq	_PageIndexTupleDelete
	movl	%r12d, %edi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movq	%rbx, %rdx
	movq	%r14, %rcx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_PageAddItem
	movq	%rax, %r15
	cmpq	(%r13), %rax
	jne	LBB0_18
## %bb.20:
	movq	_PANIC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	jmp	LBB0_24
LBB0_18:
	xorl	%edi, %edi
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	cmpq	$0, (%rbx)
	setg	%dil
	callq	_Assert
	decq	(%rbx)
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	testq	%rcx, %rcx
	je	LBB0_25
## %bb.19:
	movq	%r15, %rax
	incq	%rax
	movq	%rax, (%rcx)
	jmp	LBB0_25
	.cfi_endproc
                                        ## -- End function
	.comm	_SGDTSIZE,8,3                   ## @SGDTSIZE
	.comm	_InvalidOffsetNumber,8,3        ## @InvalidOffsetNumber
	.comm	_FirstOffsetNumber,8,3          ## @FirstOffsetNumber
	.comm	_SPGIST_PLACEHOLDER,8,3         ## @SPGIST_PLACEHOLDER
	.comm	_PANIC,4,2                      ## @PANIC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to add item of size %u to SPGiST index page"

	.comm	_ERROR,4,2                      ## @ERROR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_SpGistPageAddNewItem           ; -- Begin function SpGistPageAddNewItem
	.p2align	2
_SpGistPageAddNewItem:                  ; @SpGistPageAddNewItem
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x26, x5
	mov	x20, x4
	mov	x19, x3
	mov	x23, x2
	mov	x24, x1
	mov	x0, x1
	bl	_SpGistPageGetOpaque
	ldr	x8, [x0]
Lloh0:
	adrp	x28, _InvalidOffsetNumber@GOTPAGE
Lloh1:
	ldr	x28, [x28, _InvalidOffsetNumber@GOTPAGEOFF]
	cmp	x8, #1
	b.lt	LBB0_15
; %bb.1:
	mov	x21, x0
	mov	x0, x24
	bl	_PageGetExactFreeSpace
Lloh2:
	adrp	x8, _SGDTSIZE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SGDTSIZE@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	add	x22, x8, x0
	mov	x0, x19
	bl	_MAXALIGN
	cmp	x22, x0
	b.lt	LBB0_15
; %bb.2:
	stp	w23, w26, [sp, #8]              ; 8-byte Folded Spill
	mov	x0, x24
	bl	_PageGetMaxOffsetNumber
	mov	x26, x0
	ldr	x25, [x28]
	add	x22, x0, #1
Lloh5:
	adrp	x23, _SPGIST_PLACEHOLDER@GOTPAGE
Lloh6:
	ldr	x23, [x23, _SPGIST_PLACEHOLDER@GOTPAGEOFF]
	cbz	x20, LBB0_4
LBB0_3:
	ldr	x27, [x20]
	ldr	x8, [x28]
	cmp	x27, x8
	b.ne	LBB0_5
LBB0_4:
Lloh7:
	adrp	x8, _FirstOffsetNumber@GOTPAGE
Lloh8:
	ldr	x8, [x8, _FirstOffsetNumber@GOTPAGEOFF]
Lloh9:
	ldr	x27, [x8]
LBB0_5:
	cmp	x27, x26
	b.gt	LBB0_9
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x24
	mov	x1, x27
	bl	_PageGetItemId
	mov	x1, x0
	mov	x0, x24
	bl	_PageGetItem
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x8, w0
	ldr	x8, [x8]
	ldr	x9, [x23]
	cmp	x8, x9
	b.eq	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	add	x27, x27, #1
	cmp	x22, x27
	b.ne	LBB0_6
	b	LBB0_9
LBB0_8:
	mov	x25, x27
LBB0_9:
	ldr	x8, [x28]
	cmp	x25, x8
	b.ne	LBB0_14
; %bb.10:
	cbz	x20, LBB0_13
; %bb.11:
	ldr	x8, [x20]
	cmp	x8, x25
	b.eq	LBB0_13
; %bb.12:
	str	x25, [x20]
	cbnz	x20, LBB0_3
	b	LBB0_4
LBB0_13:
	str	xzr, [x21]
	ldr	x8, [x28]
LBB0_14:
	ldp	w23, w26, [sp, #8]              ; 8-byte Folded Reload
	cmp	x25, x8
	b.ne	LBB0_20
LBB0_15:
	ldr	x3, [x28]
	mov	x0, x24
	mov	x1, x23
	mov	x2, x19
	mov	w4, #0
	mov	w5, #0
	bl	_PageAddItem
	mov	x23, x0
	cbnz	w26, LBB0_19
; %bb.16:
	ldr	x8, [x28]
	cmp	x23, x8
	b.ne	LBB0_19
; %bb.17:
Lloh10:
	adrp	x8, _ERROR@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
LBB0_18:
	ldr	w0, [x8]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	bl	_elog
LBB0_19:
	mov	x0, x23
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_20:
	mov	x0, x24
	mov	x1, x25
	bl	_PageIndexTupleDelete
	mov	x0, x24
	mov	x1, x23
	mov	x2, x19
	mov	x3, x25
	mov	w4, #0
	mov	w5, #0
	bl	_PageAddItem
	mov	x23, x0
	ldr	x8, [x28]
	cmp	x0, x8
	b.ne	LBB0_22
; %bb.21:
Lloh14:
	adrp	x8, _PANIC@GOTPAGE
Lloh15:
	ldr	x8, [x8, _PANIC@GOTPAGEOFF]
	b	LBB0_18
LBB0_22:
	ldr	x8, [x21]
	cmp	x8, #0
	cset	w0, gt
	bl	_Assert
	ldr	x8, [x21]
	sub	x8, x8, #1
	str	x8, [x21]
	cbz	x20, LBB0_19
; %bb.23:
	add	x8, x23, #1
	str	x8, [x20]
	b	LBB0_19
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_SGDTSIZE,8,3                   ; @SGDTSIZE
	.comm	_InvalidOffsetNumber,8,3        ; @InvalidOffsetNumber
	.comm	_FirstOffsetNumber,8,3          ; @FirstOffsetNumber
	.comm	_SPGIST_PLACEHOLDER,8,3         ; @SPGIST_PLACEHOLDER
	.comm	_PANIC,4,2                      ; @PANIC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to add item of size %u to SPGiST index page"

	.comm	_ERROR,4,2                      ; @ERROR
.subsections_via_symbols
