	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function spgRedoAddLeaf
_spgRedoAddLeaf:                        ## @spgRedoAddLeaf
	.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	(%rdi), %r12d
	callq	_XLogRecGetData
	movq	%rax, %r14
	leaq	48(%rax), %r13
	leaq	-72(%rbp), %rdi
	movq	%r13, %rsi
	movl	$16, %edx
	callq	_memcpy
	cmpq	$0, 40(%r14)
	je	LBB0_4
## %bb.1:
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_XLogInitBufferForRedo
	movl	%eax, -44(%rbp)
	movq	_SPGIST_LEAF@GOTPCREL(%rip), %rcx
	cmpq	$0, 32(%r14)
	je	LBB0_3
## %bb.2:
	movq	_SPGIST_NULLS@GOTPCREL(%rip), %rdx
	movl	(%rdx), %ebx
LBB0_3:
	orl	(%rcx), %ebx
	movl	%eax, %edi
	movl	%ebx, %esi
	callq	_SpGistInitBuffer
	jmp	LBB0_5
LBB0_4:
	leaq	-44(%rbp), %rdx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_XLogReadBufferForRedo
	movq	_BLK_NEEDS_REDO@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_11
LBB0_5:
	movl	%r12d, -48(%rbp)                ## 4-byte Spill
	movl	-44(%rbp), %edi
	callq	_BufferGetPage
	movl	%eax, %r12d
	movq	(%r14), %rcx
	cmpq	8(%r14), %rcx
	jne	LBB0_6
## %bb.8:
	movl	%r12d, %edi
	movq	%rcx, %rsi
	callq	_PageIndexTupleDelete
	movl	-64(%rbp), %edx
	movq	(%r14), %rcx
	movl	%r12d, %edi
	movl	%r13d, %esi
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_PageAddItem
	cmpq	(%r14), %rax
	je	LBB0_10
## %bb.9:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	-64(%rbp), %edx
	leaq	L_.str(%rip), %rsi
	callq	_elog
	jmp	LBB0_10
LBB0_6:
	movl	-64(%rbp), %edx
	movl	%r12d, %edi
	movl	%r13d, %esi
	callq	_addOrReplaceTuple
	movq	8(%r14), %rsi
	movq	_InvalidOffsetNumber@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rsi
	je	LBB0_10
## %bb.7:
	movl	%r12d, %edi
	callq	_PageGetItemId
	movl	%r12d, %edi
	movl	%eax, %esi
	callq	_PageGetItem
	movq	%rax, %rbx
	movq	(%rax), %rax
	xorl	%edi, %edi
	cmpq	-72(%rbp), %rax
	sete	%dil
	callq	_Assert
	movq	(%r14), %rax
	movq	%rax, (%rbx)
LBB0_10:
	movl	%r12d, %edi
	movl	-48(%rbp), %r12d                ## 4-byte Reload
	movl	%r12d, %esi
	callq	_PageSetLSN
	movl	-44(%rbp), %edi
	callq	_MarkBufferDirty
LBB0_11:
	movl	-44(%rbp), %edi
	callq	_BufferIsValid
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	movl	-44(%rbp), %edi
	callq	_UnlockReleaseBuffer
LBB0_13:
	movq	16(%r14), %rax
	movq	_InvalidOffsetNumber@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_18
## %bb.14:
	leaq	-44(%rbp), %rdx
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_XLogReadBufferForRedo
	movq	_BLK_NEEDS_REDO@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_16
## %bb.15:
	leaq	-52(%rbp), %r8
	movq	%r15, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_XLogRecGetBlockTag
	movl	-44(%rbp), %edi
	callq	_BufferGetPage
	movl	%eax, %ebx
	movq	16(%r14), %rsi
	movl	%eax, %edi
	callq	_PageGetItemId
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_PageGetItem
	movl	24(%r14), %esi
	movl	-52(%rbp), %edx
	movq	(%r14), %rcx
	movq	%rax, %rdi
	callq	_spgUpdateNodeLink
	movl	%ebx, %edi
	movl	%r12d, %esi
	callq	_PageSetLSN
	movl	-44(%rbp), %edi
	callq	_MarkBufferDirty
LBB0_16:
	movl	-44(%rbp), %edi
	callq	_BufferIsValid
	testq	%rax, %rax
	je	LBB0_18
## %bb.17:
	movl	-44(%rbp), %edi
	callq	_UnlockReleaseBuffer
LBB0_18:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SPGIST_LEAF,4,2                ## @SPGIST_LEAF
	.comm	_SPGIST_NULLS,4,2               ## @SPGIST_NULLS
	.comm	_BLK_NEEDS_REDO,8,3             ## @BLK_NEEDS_REDO
	.comm	_InvalidOffsetNumber,8,3        ## @InvalidOffsetNumber
	.comm	_ERROR,4,2                      ## @ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to add item of size %u to SPGiST index page"

	.no_dead_strip	_spgRedoAddLeaf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function spgRedoAddLeaf
_spgRedoAddLeaf:                        ; @spgRedoAddLeaf
	.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, x0
	ldr	w19, [x0]
	bl	_XLogRecGetData
	mov	x20, x0
	add	x23, x0, #48
	add	x0, sp, #16
	mov	x1, x23
	mov	w2, #16
	bl	_memcpy
	ldr	x8, [x20, #40]
Lloh0:
	adrp	x24, _InvalidOffsetNumber@GOTPAGE
Lloh1:
	ldr	x24, [x24, _InvalidOffsetNumber@GOTPAGEOFF]
	cbz	x8, LBB0_2
; %bb.1:
	mov	x0, x21
	mov	w1, #0
	bl	_XLogInitBufferForRedo
	str	w0, [sp, #12]
Lloh2:
	adrp	x8, _SPGIST_LEAF@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SPGIST_LEAF@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	ldr	x9, [x20, #32]
Lloh5:
	adrp	x10, _SPGIST_NULLS@GOTPAGE
Lloh6:
	ldr	x10, [x10, _SPGIST_NULLS@GOTPAGEOFF]
Lloh7:
	ldr	w10, [x10]
	cmp	x9, #0
	csel	w9, wzr, w10, eq
	orr	w1, w9, w8
	bl	_SpGistInitBuffer
	b	LBB0_3
LBB0_2:
	add	x2, sp, #12
	mov	x0, x21
	mov	w1, #0
	bl	_XLogReadBufferForRedo
Lloh8:
	adrp	x8, _BLK_NEEDS_REDO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _BLK_NEEDS_REDO@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_9
LBB0_3:
	ldr	w0, [sp, #12]
	bl	_BufferGetPage
	mov	x22, x0
	ldp	x3, x8, [x20]
	cmp	x3, x8
	b.ne	LBB0_6
; %bb.4:
	mov	x0, x22
	mov	x1, x3
	bl	_PageIndexTupleDelete
	ldr	w2, [sp, #24]
	ldr	x3, [x20]
	mov	x0, x22
	mov	x1, x23
	mov	w4, #0
	mov	w5, #0
	bl	_PageAddItem
	ldr	x8, [x20]
	cmp	x0, x8
	b.eq	LBB0_8
; %bb.5:
Lloh11:
	adrp	x8, _ERROR@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	ldr	w2, [sp, #24]
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	bl	_elog
	b	LBB0_8
LBB0_6:
	ldr	w2, [sp, #24]
	mov	x0, x22
	mov	x1, x23
	bl	_addOrReplaceTuple
	ldr	x1, [x20, #8]
	ldr	x8, [x24]
	cmp	x1, x8
	b.eq	LBB0_8
; %bb.7:
	mov	x0, x22
	bl	_PageGetItemId
	mov	x1, x0
	mov	x0, x22
	bl	_PageGetItem
	mov	x23, x0
	ldr	x8, [x0]
	ldr	x9, [sp, #16]
	cmp	x8, x9
	cset	w0, eq
	bl	_Assert
	ldr	x8, [x20]
	str	x8, [x23]
LBB0_8:
	mov	x0, x22
	mov	x1, x19
	bl	_PageSetLSN
	ldr	w0, [sp, #12]
	bl	_MarkBufferDirty
LBB0_9:
	ldr	w0, [sp, #12]
	bl	_BufferIsValid
	cbz	x0, LBB0_11
; %bb.10:
	ldr	w0, [sp, #12]
	bl	_UnlockReleaseBuffer
LBB0_11:
	ldr	x8, [x20, #16]
	ldr	x9, [x24]
	cmp	x8, x9
	b.eq	LBB0_16
; %bb.12:
	add	x2, sp, #12
	mov	x0, x21
	mov	w1, #1
	bl	_XLogReadBufferForRedo
Lloh16:
	adrp	x8, _BLK_NEEDS_REDO@GOTPAGE
Lloh17:
	ldr	x8, [x8, _BLK_NEEDS_REDO@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_14
; %bb.13:
	add	x4, sp, #8
	mov	x0, x21
	mov	w1, #0
	mov	x2, #0
	mov	x3, #0
	bl	_XLogRecGetBlockTag
	ldr	w0, [sp, #12]
	bl	_BufferGetPage
	mov	x21, x0
	ldr	x1, [x20, #16]
	bl	_PageGetItemId
	mov	x1, x0
	mov	x0, x21
	bl	_PageGetItem
	ldr	w1, [x20, #24]
	ldr	w2, [sp, #8]
	ldr	x3, [x20]
	bl	_spgUpdateNodeLink
	mov	x0, x21
	mov	x1, x19
	bl	_PageSetLSN
	ldr	w0, [sp, #12]
	bl	_MarkBufferDirty
LBB0_14:
	ldr	w0, [sp, #12]
	bl	_BufferIsValid
	cbz	x0, LBB0_16
; %bb.15:
	ldr	w0, [sp, #12]
	bl	_UnlockReleaseBuffer
LBB0_16:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_SPGIST_LEAF,4,2                ; @SPGIST_LEAF
	.comm	_SPGIST_NULLS,4,2               ; @SPGIST_NULLS
	.comm	_BLK_NEEDS_REDO,8,3             ; @BLK_NEEDS_REDO
	.comm	_InvalidOffsetNumber,8,3        ; @InvalidOffsetNumber
	.comm	_ERROR,4,2                      ; @ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to add item of size %u to SPGiST index page"

	.no_dead_strip	_spgRedoAddLeaf
.subsections_via_symbols
