	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _bt_buildadd
__bt_buildadd:                          ## @_bt_buildadd
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r13
	movq	%rsi, %r14
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	xorl	%eax, %eax
	callq	_CHECK_FOR_INTERRUPTS
	movq	32(%r14), %rbx
	movq	(%r14), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	24(%r14), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_PageGetFreeSpace
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%r13, %rdi
	callq	_IndexTupleSize
	movl	%eax, %edi
	callq	_MAXALIGN
	movq	%rax, %r12
	movq	8(%r14), %r15
	movq	%rbx, %rdi
	callq	_BTMaxItemSize
	xorl	%edi, %edi
	movq	%r12, -96(%rbp)                 ## 8-byte Spill
	cmpq	%rax, %r12
	movq	%rbx, %r12
	movq	%r15, %rbx
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	setg	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	xorl	%edx, %edx
	testq	%rbx, %rbx
	sete	%dl
	movl	(%r15), %edi
	movl	12(%r15), %esi
	movq	%r12, %rcx
	movq	%r13, %r8
	callq	__bt_check_third_page
LBB0_2:
	movq	%r13, -80(%rbp)                 ## 8-byte Spill
	movq	%rbx, -112(%rbp)                ## 8-byte Spill
	testq	%rbx, %rbx
	je	LBB0_4
## %bb.3:
	xorl	%eax, %eax
	jmp	LBB0_5
LBB0_4:
	movl	$4, %edi
	callq	_MAXALIGN
LBB0_5:
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	addq	-96(%rbp), %rax                 ## 8-byte Folded Reload
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	cmpq	%rax, %rcx
	jl	LBB0_9
## %bb.6:
	movq	%rcx, %rax
	cmpq	16(%r14), %rcx
	jge	LBB0_7
## %bb.8:
	movq	_P_FIRSTKEY@GOTPCREL(%rip), %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	cmpq	(%rax), %rcx
	jle	LBB0_7
LBB0_9:
	movq	8(%r14), %rdi
	callq	__bt_blnewpage
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movslq	8(%rbx), %rax
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	incl	%eax
	movl	%eax, 8(%rbx)
	movq	_P_FIRSTKEY@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	cmpq	(%rax), %r15
	setg	%dil
	callq	_Assert
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_PageGetItemId
	movq	%r12, %r13
	movq	%rax, %r12
	movq	%r13, %rdi
	movq	%rax, %rsi
	callq	_PageGetItem
	movq	%rax, %r15
	movq	%r12, %rdi
	callq	_ItemIdGetLength
	movq	_P_FIRSTKEY@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%rax, %rsi
	movq	%r15, -88(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdx
	movq	%rbx, %r15
	callq	__bt_sortaddtup
	movq	_P_HIKEY@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rsi
	movq	%r13, %rdi
	callq	_PageGetItemId
	movl	(%r12), %ecx
	movl	%ecx, (%rax)
	movq	%r12, %rdi
	callq	_ItemIdSetUnused
	addl	$-4, (%r13)
	cmpq	$0, -112(%rbp)                  ## 8-byte Folded Reload
	je	LBB0_10
## %bb.13:
	cmpq	$0, 48(%r14)
	jne	LBB0_15
LBB0_14:
	movq	8(%r14), %rsi
	incq	%rsi
	movq	%r15, %rdi
	callq	__bt_pagestate
	movq	%rax, 48(%r14)
LBB0_15:
	movq	40(%r14), %rdi
	movl	(%r15), %esi
	callq	_BTreeTupleGetNAtts
	movq	%rax, %rbx
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	callq	_IndexRelationGetNumberOfKeyAttributes
	cmpq	%rax, %rbx
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	jg	LBB0_17
## %bb.16:
	movq	40(%r14), %rdi
	movl	(%rbx), %esi
	callq	_BTreeTupleGetNAtts
	movl	$1, %edi
	testq	%rax, %rax
	jg	LBB0_18
LBB0_17:
	movq	%r13, %rdi
	callq	_PageGetSpecialPointer
	movq	%rax, %rdi
	callq	_P_LEFTMOST
	xorl	%edi, %edi
	testq	%rax, %rax
	setne	%dil
LBB0_18:
	callq	_Assert
	movq	40(%r14), %rdi
	movl	(%rbx), %esi
	callq	_BTreeTupleGetNAtts
	testq	%rax, %rax
	je	LBB0_19
## %bb.20:
	movq	%r13, %rdi
	callq	_PageGetSpecialPointer
	movq	%rax, %rdi
	callq	_P_LEFTMOST
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	jmp	LBB0_21
LBB0_10:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_OffsetNumberPrev
	movq	%r13, %rdi
	movq	%rax, %rsi
	callq	_PageGetItemId
	movq	%r13, %rdi
	movq	%rax, %rsi
	callq	_PageGetItem
	movl	(%r15), %edi
	movl	4(%r15), %ecx
	movq	%rax, %rsi
	movq	-88(%rbp), %rdx                 ## 8-byte Reload
	callq	__bt_truncate
	movq	%rbx, %rcx
	movq	%rax, %rbx
	movq	%r13, %r12
	movq	(%rcx), %r13
	movq	%rax, %rdi
	callq	_IndexTupleSize
	movq	%r12, %rdi
	movq	%r13, %rsi
	movl	%ebx, %edx
	movq	%rax, %rcx
	callq	_PageIndexTupleOverwrite
	testl	%eax, %eax
	jne	LBB0_12
## %bb.11:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_elog
LBB0_12:
	movq	%rbx, %rdi
	callq	_pfree
	movq	_P_HIKEY@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r12, %rdi
	callq	_PageGetItemId
	movq	%r12, %rdi
	movq	%rax, %rsi
	callq	_PageGetItem
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movq	%r12, %r13
	cmpq	$0, 48(%r14)
	jne	LBB0_15
	jmp	LBB0_14
LBB0_19:
	movl	$1, %edi
LBB0_21:
	callq	_Assert
	movq	40(%r14), %rdi
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rsi
	callq	_BTreeInnerTupleSetDownLink
	movq	40(%r14), %rdx
	movq	48(%r14), %rsi
	movq	%rbx, %rdi
	callq	__bt_buildadd
	movq	40(%r14), %rdi
	callq	_pfree
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	callq	_CopyIndexTuple
	movq	%rax, 40(%r14)
	movq	%r13, %rdi
	callq	_PageGetSpecialPointer
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	%r13, %r14
	movq	%rbx, %r12
	movq	%rax, %rbx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_PageGetSpecialPointer
	movq	-104(%rbp), %r13                ## 8-byte Reload
	movq	%r13, (%rbx)
	movq	%r15, 8(%rax)
	movq	_P_NONE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, (%rax)
	movq	%r12, %rdi
	movq	%r14, %rsi
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r15, %rdx
	callq	__bt_blwritepage
	movq	_P_FIRSTKEY@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	-80(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_22
LBB0_7:
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movq	-80(%rbp), %r12                 ## 8-byte Reload
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
LBB0_22:
	movq	_P_HIKEY@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	jne	LBB0_24
## %bb.23:
	xorl	%edi, %edi
	cmpq	$0, 40(%r14)
	sete	%dil
	callq	_Assert
	movl	$4, %edi
	callq	_palloc0
	movq	%rax, 40(%r14)
	movl	$4, (%rax)
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_BTreeTupleSetNAtts
LBB0_24:
	movq	%rbx, %rdi
	callq	_OffsetNumberNext
	movq	%rax, %r15
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movq	-96(%rbp), %rsi                 ## 8-byte Reload
	movq	%r12, %rdx
	movq	%rax, %rcx
	callq	__bt_sortaddtup
	movq	%rbx, 32(%r14)
	movq	%r13, 24(%r14)
	movq	%r15, (%r14)
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_P_FIRSTKEY,8,3                 ## @P_FIRSTKEY
	.comm	_P_HIKEY,8,3                    ## @P_HIKEY
	.comm	_ERROR,4,2                      ## @ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to add high key to the index page"

	.comm	_P_NONE,8,3                     ## @P_NONE
	.no_dead_strip	__bt_buildadd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _bt_buildadd
__bt_buildadd:                          ; @_bt_buildadd
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x27, x2
	mov	x19, x1
	mov	x24, x0
	bl	_CHECK_FOR_INTERRUPTS
	ldp	x21, x23, [x19, #24]
	ldr	x26, [x19]
	mov	x0, x23
	bl	_PageGetFreeSpace
	mov	x25, x0
	mov	x0, x27
	bl	_IndexTupleSize
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_MAXALIGN
	mov	x28, x0
	ldr	x22, [x19, #8]
	mov	x0, x23
	bl	_BTMaxItemSize
	cmp	x28, x0
	cset	w0, gt
	bl	_unlikely
	cbz	x0, LBB0_2
; %bb.1:
	cmp	x22, #0
	cset	w2, eq
	ldr	w0, [x24]
	ldr	w1, [x24, #12]
	mov	x3, x23
	mov	x4, x27
	bl	__bt_check_third_page
LBB0_2:
	cbz	x22, LBB0_4
; %bb.3:
	mov	x0, #0
	b	LBB0_5
LBB0_4:
	mov	w0, #4
	bl	_MAXALIGN
LBB0_5:
	add	x8, x0, x28
	cmp	x25, x8
Lloh0:
	adrp	x20, _P_FIRSTKEY@GOTPAGE
Lloh1:
	ldr	x20, [x20, _P_FIRSTKEY@GOTPAGEOFF]
	b.lt	LBB0_8
; %bb.6:
	ldr	x8, [x19, #16]
	cmp	x25, x8
	b.ge	LBB0_22
; %bb.7:
	ldr	x8, [x20]
	cmp	x26, x8
	b.le	LBB0_22
LBB0_8:
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	ldr	x0, [x19, #8]
	bl	__bt_blnewpage
	mov	x25, x0
	ldrsw	x8, [x24, #8]
	str	x8, [sp, #8]                    ; 8-byte Folded Spill
	add	w8, w8, #1
	str	w8, [x24, #8]
	ldr	x8, [x20]
	cmp	x26, x8
	cset	w0, gt
	bl	_Assert
	mov	x0, x23
	mov	x1, x26
	bl	_PageGetItemId
	mov	x28, x0
	mov	x0, x23
	mov	x1, x28
	bl	_PageGetItem
	mov	x27, x0
	mov	x0, x28
	bl	_ItemIdGetLength
	mov	x1, x0
	ldr	x3, [x20]
	mov	x0, x25
	mov	x2, x27
	bl	__bt_sortaddtup
Lloh2:
	adrp	x8, _P_HIKEY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _P_HIKEY@GOTPAGEOFF]
Lloh4:
	ldr	x1, [x8]
	mov	x0, x23
	bl	_PageGetItemId
	ldr	w8, [x28]
	str	w8, [x0]
	mov	x0, x28
	bl	_ItemIdSetUnused
	ldr	w8, [x23]
	sub	w8, w8, #4
	str	w8, [x23]
	cbz	x22, LBB0_17
; %bb.9:
	ldr	x8, [x19, #48]
	cbnz	x8, LBB0_11
LBB0_10:
	ldr	x8, [x19, #8]
	add	x1, x8, #1
	mov	x0, x24
	bl	__bt_pagestate
	str	x0, [x19, #48]
LBB0_11:
	ldr	x0, [x19, #40]
	ldr	w1, [x24]
	bl	_BTreeTupleGetNAtts
	mov	x26, x0
	ldr	w0, [x24]
	bl	_IndexRelationGetNumberOfKeyAttributes
	cmp	x26, x0
	ldr	x28, [sp, #16]                  ; 8-byte Folded Reload
Lloh5:
	adrp	x22, _P_HIKEY@GOTPAGE
Lloh6:
	ldr	x22, [x22, _P_HIKEY@GOTPAGEOFF]
	b.gt	LBB0_14
; %bb.12:
	ldr	x0, [x19, #40]
	ldr	w1, [x24]
	bl	_BTreeTupleGetNAtts
	cmp	x0, #0
	b.le	LBB0_14
; %bb.13:
	mov	w0, #1
	b	LBB0_15
LBB0_14:
	mov	x0, x23
	bl	_PageGetSpecialPointer
	bl	_P_LEFTMOST
	cmp	x0, #0
	cset	w0, ne
LBB0_15:
	bl	_Assert
	ldr	x0, [x19, #40]
	ldr	w1, [x24]
	bl	_BTreeTupleGetNAtts
	cbz	x0, LBB0_20
; %bb.16:
	mov	x0, x23
	bl	_PageGetSpecialPointer
	bl	_P_LEFTMOST
	cmp	x0, #0
	cset	w0, eq
	b	LBB0_21
LBB0_17:
	mov	x0, x26
	bl	_OffsetNumberPrev
	mov	x1, x0
	mov	x0, x23
	bl	_PageGetItemId
	mov	x1, x0
	mov	x0, x23
	bl	_PageGetItem
	mov	x1, x0
	ldp	w0, w3, [x24]
	mov	x2, x27
	bl	__bt_truncate
	mov	x26, x0
Lloh7:
	adrp	x22, _P_HIKEY@GOTPAGE
Lloh8:
	ldr	x22, [x22, _P_HIKEY@GOTPAGEOFF]
	ldr	x27, [x22]
	bl	_IndexTupleSize
	mov	x3, x0
	mov	x0, x23
	mov	x1, x27
	mov	x2, x26
	bl	_PageIndexTupleOverwrite
	cbnz	w0, LBB0_19
; %bb.18:
Lloh9:
	adrp	x8, _ERROR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	bl	_elog
LBB0_19:
	mov	x0, x26
	bl	_pfree
	ldr	x1, [x22]
	mov	x0, x23
	bl	_PageGetItemId
	mov	x1, x0
	mov	x0, x23
	bl	_PageGetItem
	mov	x27, x0
	ldr	x8, [x19, #48]
	cbnz	x8, LBB0_11
	b	LBB0_10
LBB0_20:
	mov	w0, #1
LBB0_21:
	bl	_Assert
	ldr	x0, [x19, #40]
	mov	x1, x21
	bl	_BTreeInnerTupleSetDownLink
	ldp	x2, x1, [x19, #40]
	mov	x0, x24
	bl	__bt_buildadd
	ldr	x0, [x19, #40]
	bl	_pfree
	mov	x0, x27
	bl	_CopyIndexTuple
	str	x0, [x19, #40]
	mov	x0, x23
	bl	_PageGetSpecialPointer
	mov	x26, x0
	mov	x0, x25
	bl	_PageGetSpecialPointer
	ldr	x20, [sp, #8]                   ; 8-byte Folded Reload
	str	x20, [x26]
Lloh14:
	adrp	x8, _P_NONE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _P_NONE@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	stp	x8, x21, [x0]
	mov	x0, x24
	mov	x1, x23
	mov	x2, x21
	bl	__bt_blwritepage
Lloh17:
	adrp	x8, _P_FIRSTKEY@GOTPAGE
Lloh18:
	ldr	x8, [x8, _P_FIRSTKEY@GOTPAGEOFF]
Lloh19:
	ldr	x26, [x8]
	mov	x21, x20
	ldr	x27, [sp, #24]                  ; 8-byte Folded Reload
	b	LBB0_23
LBB0_22:
	mov	x25, x23
Lloh20:
	adrp	x22, _P_HIKEY@GOTPAGE
Lloh21:
	ldr	x22, [x22, _P_HIKEY@GOTPAGEOFF]
LBB0_23:
	ldr	x8, [x22]
	cmp	x26, x8
	b.ne	LBB0_25
; %bb.24:
	ldr	x8, [x19, #40]
	cmp	x8, #0
	cset	w0, eq
	bl	_Assert
	mov	w20, #4
	mov	w0, #4
	bl	_palloc0
	str	x0, [x19, #40]
	str	w20, [x0]
	mov	w1, #0
	bl	_BTreeTupleSetNAtts
LBB0_25:
	mov	x0, x26
	bl	_OffsetNumberNext
	mov	x23, x0
	mov	x0, x25
	mov	x1, x28
	mov	x2, x27
	mov	x3, x23
	bl	__bt_sortaddtup
	stp	x21, x25, [x19, #24]
	str	x23, [x19]
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_P_FIRSTKEY,8,3                 ; @P_FIRSTKEY
	.comm	_P_HIKEY,8,3                    ; @P_HIKEY
	.comm	_ERROR,4,2                      ; @ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to add high key to the index page"

	.comm	_P_NONE,8,3                     ; @P_NONE
	.no_dead_strip	__bt_buildadd
.subsections_via_symbols
