	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_brinbuild                      ## -- Begin function brinbuild
	.p2align	4, 0x90
_brinbuild:                             ## @brinbuild
	.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	%rdx, -48(%rbp)                 ## 8-byte Spill
	movl	%esi, %r12d
	movl	%edi, %r15d
	movl	%esi, %edi
	callq	_RelationGetNumberOfBlocks
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%r12d, %edi
	callq	_RelationGetRelationName
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edi
	movl	%eax, %edx
	callq	_elog
LBB0_2:
	movq	_P_NEW@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r12d, %edi
	callq	_ReadBuffer
	movl	%eax, %r13d
	movl	%eax, %edi
	callq	_BufferGetBlockNumber
	movq	_BRIN_METAPAGE_BLKNO@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	sete	%dil
	callq	_Assert
	movq	_BUFFER_LOCK_EXCLUSIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r13d, %edi
	callq	_LockBuffer
	movl	%r13d, %edi
	callq	_BufferGetPage
	movl	%eax, %ebx
	movl	%r12d, %edi
	callq	_BrinGetPagesPerRange
	movq	_BRIN_CURRENT_VERSION@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_brin_metapage_init
	movl	%r13d, %edi
	callq	_MarkBufferDirty
	movl	%r12d, %edi
	callq	_RelationNeedsWAL
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movl	(%r14), %eax
	movl	%eax, -60(%rbp)
	movl	%r12d, %edi
	callq	_BrinGetPagesPerRange
	movl	%eax, -64(%rbp)
	xorl	%eax, %eax
	callq	_XLogBeginInsert
	movq	_SizeOfBrinCreateIdx@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-64(%rbp), %rdi
	callq	_XLogRegisterData
	movq	_REGBUF_WILL_INIT@GOTPCREL(%rip), %rax
	movq	_REGBUF_STANDARD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	xorl	%edi, %edi
	movl	%r13d, %esi
	callq	_XLogRegisterBuffer
	movq	_RM_BRIN_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_XLOG_BRIN_CREATE_INDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_XLogInsert
	movl	%eax, %ebx
	movl	%r13d, %edi
	callq	_BufferGetPage
	movl	%eax, %edi
	movl	%ebx, %esi
	callq	_PageSetLSN
LBB0_4:
	movl	%r13d, %edi
	callq	_UnlockReleaseBuffer
	leaq	-52(%rbp), %rsi
	movl	%r12d, %edi
	xorl	%edx, %edx
	callq	_brinRevmapInitialize
	movl	-52(%rbp), %edx
	movl	%r12d, %edi
	movq	%rax, %rsi
	callq	_initialize_brin_buildstate
	movq	%rax, %rbx
	movq	_brinbuildCallback@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movl	%r15d, %edi
	movl	%r12d, %esi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	xorl	%ecx, %ecx
	movl	$1, %r8d
	pushq	$0
	pushq	%rbx
	callq	_table_index_build_scan
	addq	$16, %rsp
	movsd	%xmm0, -48(%rbp)                ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_form_and_insert_tuple
	movsd	(%rbx), %xmm0                   ## xmm0 = mem[0],zero
	movsd	%xmm0, -72(%rbp)                ## 8-byte Spill
	movl	8(%rbx), %edi
	callq	_brinRevmapTerminate
	movq	%rbx, %rdi
	callq	_terminate_brin_buildstate
	movl	$16, %edi
	callq	_palloc
	movsd	-48(%rbp), %xmm0                ## 8-byte Reload
                                        ## xmm0 = mem[0],zero
	movsd	%xmm0, (%rax)
	movsd	-72(%rbp), %xmm0                ## 8-byte Reload
                                        ## xmm0 = mem[0],zero
	movsd	%xmm0, 8(%rax)
	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	"index \"%s\" already contains data"

	.comm	_P_NEW,4,2                      ## @P_NEW
	.comm	_BRIN_METAPAGE_BLKNO,8,3        ## @BRIN_METAPAGE_BLKNO
	.comm	_BUFFER_LOCK_EXCLUSIVE,4,2      ## @BUFFER_LOCK_EXCLUSIVE
	.comm	_BRIN_CURRENT_VERSION,4,2       ## @BRIN_CURRENT_VERSION
	.comm	_SizeOfBrinCreateIdx,4,2        ## @SizeOfBrinCreateIdx
	.comm	_REGBUF_WILL_INIT,4,2           ## @REGBUF_WILL_INIT
	.comm	_REGBUF_STANDARD,4,2            ## @REGBUF_STANDARD
	.comm	_RM_BRIN_ID,4,2                 ## @RM_BRIN_ID
	.comm	_XLOG_BRIN_CREATE_INDEX,4,2     ## @XLOG_BRIN_CREATE_INDEX
	.comm	_brinbuildCallback,4,2          ## @brinbuildCallback
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_brinbuild                      ; -- Begin function brinbuild
	.p2align	2
_brinbuild:                             ; @brinbuild
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	d9, d8, [sp, #16]               ; 16-byte Folded Spill
	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
	.cfi_offset b8, -72
	.cfi_offset b9, -80
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	mov	x0, x1
	bl	_RelationGetNumberOfBlocks
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _ERROR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
	mov	x0, x20
	bl	_RelationGetRelationName
	mov	x2, x0
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	bl	_elog
LBB0_2:
Lloh5:
	adrp	x8, _P_NEW@GOTPAGE
Lloh6:
	ldr	x8, [x8, _P_NEW@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_ReadBuffer
	mov	x22, x0
	bl	_BufferGetBlockNumber
Lloh8:
	adrp	x8, _BRIN_METAPAGE_BLKNO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _BRIN_METAPAGE_BLKNO@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	cmp	x0, x8
	cset	w0, eq
	bl	_Assert
Lloh11:
	adrp	x8, _BUFFER_LOCK_EXCLUSIVE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _BUFFER_LOCK_EXCLUSIVE@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_LockBuffer
	mov	x0, x22
	bl	_BufferGetPage
	mov	x23, x0
	mov	x0, x20
	bl	_BrinGetPagesPerRange
	mov	x1, x0
Lloh14:
	adrp	x24, _BRIN_CURRENT_VERSION@GOTPAGE
Lloh15:
	ldr	x24, [x24, _BRIN_CURRENT_VERSION@GOTPAGEOFF]
	ldr	w2, [x24]
	mov	x0, x23
	bl	_brin_metapage_init
	mov	x0, x22
	bl	_MarkBufferDirty
	mov	x0, x20
	bl	_RelationNeedsWAL
	cbz	x0, LBB0_4
; %bb.3:
	ldr	w8, [x24]
	str	w8, [sp, #4]
	mov	x0, x20
	bl	_BrinGetPagesPerRange
	str	w0, [sp]
	bl	_XLogBeginInsert
Lloh16:
	adrp	x8, _SizeOfBrinCreateIdx@GOTPAGE
Lloh17:
	ldr	x8, [x8, _SizeOfBrinCreateIdx@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, sp
	bl	_XLogRegisterData
Lloh19:
	adrp	x8, _REGBUF_WILL_INIT@GOTPAGE
Lloh20:
	ldr	x8, [x8, _REGBUF_WILL_INIT@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
Lloh22:
	adrp	x9, _REGBUF_STANDARD@GOTPAGE
Lloh23:
	ldr	x9, [x9, _REGBUF_STANDARD@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	w0, #0
	mov	x1, x22
	bl	_XLogRegisterBuffer
Lloh25:
	adrp	x8, _RM_BRIN_ID@GOTPAGE
Lloh26:
	ldr	x8, [x8, _RM_BRIN_ID@GOTPAGEOFF]
Lloh27:
	ldr	w0, [x8]
Lloh28:
	adrp	x8, _XLOG_BRIN_CREATE_INDEX@GOTPAGE
Lloh29:
	ldr	x8, [x8, _XLOG_BRIN_CREATE_INDEX@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	bl	_XLogInsert
	mov	x23, x0
	mov	x0, x22
	bl	_BufferGetPage
	mov	x1, x23
	bl	_PageSetLSN
LBB0_4:
	mov	x0, x22
	bl	_UnlockReleaseBuffer
	add	x1, sp, #12
	mov	x0, x20
	mov	x2, #0
	bl	_brinRevmapInitialize
	mov	x1, x0
	ldr	w2, [sp, #12]
	mov	x0, x20
	bl	_initialize_brin_buildstate
	mov	x22, x0
Lloh31:
	adrp	x8, _brinbuildCallback@GOTPAGE
Lloh32:
	ldr	x8, [x8, _brinbuildCallback@GOTPAGEOFF]
Lloh33:
	ldr	w5, [x8]
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	mov	w3, #0
	mov	w4, #1
	mov	x6, x22
	mov	x7, #0
	bl	_table_index_build_scan
	fmov	d8, d0
	mov	x0, x22
	bl	_form_and_insert_tuple
	ldr	d9, [x22]
	ldr	w0, [x22, #8]
	bl	_brinRevmapTerminate
	mov	x0, x22
	bl	_terminate_brin_buildstate
	mov	w0, #16
	bl	_palloc
	stp	d8, d9, [x0]
	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
	ldp	d9, d8, [sp, #16]               ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_ERROR,4,2                      ; @ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"index \"%s\" already contains data"

	.comm	_P_NEW,4,2                      ; @P_NEW
	.comm	_BRIN_METAPAGE_BLKNO,8,3        ; @BRIN_METAPAGE_BLKNO
	.comm	_BUFFER_LOCK_EXCLUSIVE,4,2      ; @BUFFER_LOCK_EXCLUSIVE
	.comm	_BRIN_CURRENT_VERSION,4,2       ; @BRIN_CURRENT_VERSION
	.comm	_SizeOfBrinCreateIdx,4,2        ; @SizeOfBrinCreateIdx
	.comm	_REGBUF_WILL_INIT,4,2           ; @REGBUF_WILL_INIT
	.comm	_REGBUF_STANDARD,4,2            ; @REGBUF_STANDARD
	.comm	_RM_BRIN_ID,4,2                 ; @RM_BRIN_ID
	.comm	_XLOG_BRIN_CREATE_INDEX,4,2     ; @XLOG_BRIN_CREATE_INDEX
	.comm	_brinbuildCallback,4,2          ; @brinbuildCallback
.subsections_via_symbols
