	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_FlushRelationBuffers           ## -- Begin function FlushRelationBuffers
	.p2align	4, 0x90
_FlushRelationBuffers:                  ## @FlushRelationBuffers
	.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, %rbx
	callq	_RelationOpenSmgr
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_RelationUsesLocalBuffers
	testq	%rax, %rax
	je	LBB0_7
## %bb.1:
	movq	_NLocBuffer@GOTPCREL(%rip), %r14
	cmpl	$0, (%r14)
	jle	LBB0_15
## %bb.2:
	xorl	%ebx, %ebx
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	incl	%ebx
	cmpl	(%r14), %ebx
	jge	LBB0_15
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	callq	_GetLocalBufferDescriptor
	movq	%rax, %r12
	movl	(%rax), %edi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	4(%rax), %esi
	callq	_RelFileNodeEquals
	testq	%rax, %rax
	je	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	leaq	12(%r12), %r15
	movq	%r15, %rdi
	callq	_pg_atomic_read_u32
	movl	%eax, %r13d
	movq	_BM_DIRTY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_BM_VALID@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%r13d, %ecx
	notl	%ecx
	testl	%ecx, %eax
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r12, %rdi
	callq	_LocalBufHdrGetBlock
	movq	%rax, %r14
	movq	_local_buffer_write_error_callback@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -56(%rbp)
	movq	%r12, -64(%rbp)
	movq	_error_context_stack@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rax
	movq	%rax, -72(%rbp)
	leaq	-72(%rbp), %rax
	movq	%rax, (%rcx)
	movl	4(%r12), %esi
	movq	%r14, %rdi
	callq	_PageSetChecksumInplace
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movl	4(%r12), %edx
	movl	8(%r12), %esi
	movq	%r14, %rcx
	movq	_NLocBuffer@GOTPCREL(%rip), %r14
	xorl	%r8d, %r8d
	callq	_smgrwrite
	movq	_BM_JUST_DIRTIED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_BM_DIRTY@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	notl	%eax
	andl	%eax, %r13d
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	_pg_atomic_unlocked_write_u32
	movq	-72(%rbp), %rax
	movq	_error_context_stack@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	jmp	LBB0_6
LBB0_7:
	movq	_CurrentResourceOwner@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ResourceOwnerEnlargeBuffers
	movq	_NBuffers@GOTPCREL(%rip), %r14
	cmpl	$0, (%r14)
	jle	LBB0_15
## %bb.8:
	movq	_BM_DIRTY@GOTPCREL(%rip), %r13
	xorl	%ebx, %ebx
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	%r15, %rdi
	movl	%r12d, %esi
	callq	_UnlockBufHdr
LBB0_14:                                ##   in Loop: Header=BB0_9 Depth=1
	incl	%ebx
	cmpl	(%r14), %ebx
	jge	LBB0_15
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	callq	_GetBufferDescriptor
	movq	%rax, %r15
	movl	(%rax), %edi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	4(%rax), %esi
	callq	_RelFileNodeEquals
	testq	%rax, %rax
	je	LBB0_14
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	xorl	%eax, %eax
	callq	_ReservePrivateRefCountEntry
	movq	%r15, %rdi
	callq	_LockBufHdr
	movl	%eax, %r12d
	movl	(%r15), %edi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	4(%rax), %esi
	callq	_RelFileNodeEquals
	testq	%rax, %rax
	je	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	(%r13), %eax
	movq	_BM_VALID@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%r12d, %ecx
	notl	%ecx
	testl	%ecx, %eax
	jne	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%r15, %rdi
	callq	_PinBuffer_Locked
	movq	%r15, %rdi
	callq	_BufferDescriptorGetContentLock
	movq	_LW_SHARED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_LWLockAcquire
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_FlushBuffer
	movq	%r15, %rdi
	callq	_BufferDescriptorGetContentLock
	movl	%eax, %edi
	callq	_LWLockRelease
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_UnpinBuffer
	jmp	LBB0_14
LBB0_15:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NLocBuffer,4,2                 ## @NLocBuffer
	.comm	_BM_VALID,4,2                   ## @BM_VALID
	.comm	_BM_DIRTY,4,2                   ## @BM_DIRTY
	.comm	_local_buffer_write_error_callback,4,2 ## @local_buffer_write_error_callback
	.comm	_error_context_stack,8,3        ## @error_context_stack
	.comm	_BM_JUST_DIRTIED,4,2            ## @BM_JUST_DIRTIED
	.comm	_CurrentResourceOwner,4,2       ## @CurrentResourceOwner
	.comm	_NBuffers,4,2                   ## @NBuffers
	.comm	_LW_SHARED,4,2                  ## @LW_SHARED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_FlushRelationBuffers           ; -- Begin function FlushRelationBuffers
	.p2align	2
_FlushRelationBuffers:                  ; @FlushRelationBuffers
	.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	x19, x0
	bl	_RelationOpenSmgr
	mov	x0, x19
	bl	_RelationUsesLocalBuffers
	cbz	x0, LBB0_7
; %bb.1:
Lloh0:
	adrp	x25, _NLocBuffer@GOTPAGE
Lloh1:
	ldr	x25, [x25, _NLocBuffer@GOTPAGEOFF]
	ldr	w8, [x25]
	cmp	w8, #1
	b.lt	LBB0_15
; %bb.2:
	mov	w20, #0
Lloh2:
	adrp	x26, _BM_VALID@GOTPAGE
Lloh3:
	ldr	x26, [x26, _BM_VALID@GOTPAGEOFF]
Lloh4:
	adrp	x27, _BM_DIRTY@GOTPAGE
Lloh5:
	ldr	x27, [x27, _BM_DIRTY@GOTPAGEOFF]
Lloh6:
	adrp	x28, _error_context_stack@GOTPAGE
Lloh7:
	ldr	x28, [x28, _error_context_stack@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	w20, w20, #1
	ldr	w8, [x25]
	cmp	w20, w8
	b.ge	LBB0_15
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_GetLocalBufferDescriptor
	mov	x22, x0
	ldr	w0, [x0]
	ldr	w1, [x19, #4]
	bl	_RelFileNodeEquals
	cbz	x0, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x21, x22, #12
	mov	x0, x21
	bl	_pg_atomic_read_u32
	ldr	w8, [x26]
	ldr	w9, [x27]
	orr	w8, w9, w8
	bics	wzr, w8, w0
	b.ne	LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x23, x0
	mov	x0, x22
	bl	_LocalBufHdrGetBlock
	mov	x24, x0
Lloh8:
	adrp	x8, _local_buffer_write_error_callback@GOTPAGE
Lloh9:
	ldr	x8, [x8, _local_buffer_write_error_callback@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	str	w8, [sp, #24]
	ldr	x8, [x28]
	stp	x8, x22, [sp, #8]
	add	x8, sp, #8
	str	x8, [x28]
	ldr	w1, [x22, #4]
	bl	_PageSetChecksumInplace
	ldr	w0, [x19]
	ldp	w2, w1, [x22, #4]
	mov	x3, x24
	mov	w4, #0
	bl	_smgrwrite
	ldr	w8, [x27]
Lloh11:
	adrp	x9, _BM_JUST_DIRTIED@GOTPAGE
Lloh12:
	ldr	x9, [x9, _BM_JUST_DIRTIED@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	orr	w8, w9, w8
	bic	w1, w23, w8
	mov	x0, x21
	bl	_pg_atomic_unlocked_write_u32
	ldr	x8, [sp, #8]
	str	x8, [x28]
	b	LBB0_3
LBB0_7:
Lloh14:
	adrp	x8, _CurrentResourceOwner@GOTPAGE
Lloh15:
	ldr	x8, [x8, _CurrentResourceOwner@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	bl	_ResourceOwnerEnlargeBuffers
Lloh17:
	adrp	x23, _NBuffers@GOTPAGE
Lloh18:
	ldr	x23, [x23, _NBuffers@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_15
; %bb.8:
	mov	w20, #0
Lloh19:
	adrp	x24, _BM_VALID@GOTPAGE
Lloh20:
	ldr	x24, [x24, _BM_VALID@GOTPAGEOFF]
Lloh21:
	adrp	x25, _BM_DIRTY@GOTPAGE
Lloh22:
	ldr	x25, [x25, _BM_DIRTY@GOTPAGEOFF]
Lloh23:
	adrp	x26, _LW_SHARED@GOTPAGE
Lloh24:
	ldr	x26, [x26, _LW_SHARED@GOTPAGEOFF]
	b	LBB0_11
LBB0_9:                                 ;   in Loop: Header=BB0_11 Depth=1
	mov	x0, x21
	mov	x1, x22
	bl	_UnlockBufHdr
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=1
	add	w20, w20, #1
	ldr	w8, [x23]
	cmp	w20, w8
	b.ge	LBB0_15
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_GetBufferDescriptor
	mov	x21, x0
	ldr	w0, [x0]
	ldr	w1, [x19, #4]
	bl	_RelFileNodeEquals
	cbz	x0, LBB0_10
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	bl	_ReservePrivateRefCountEntry
	mov	x0, x21
	bl	_LockBufHdr
	mov	x22, x0
	ldr	w0, [x21]
	ldr	w1, [x19, #4]
	bl	_RelFileNodeEquals
	cbz	x0, LBB0_9
; %bb.13:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	w8, [x24]
	ldr	w9, [x25]
	orr	w8, w9, w8
	bics	wzr, w8, w22
	b.ne	LBB0_9
; %bb.14:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x0, x21
	bl	_PinBuffer_Locked
	mov	x0, x21
	bl	_BufferDescriptorGetContentLock
	ldr	w1, [x26]
	bl	_LWLockAcquire
	ldr	w1, [x19]
	mov	x0, x21
	bl	_FlushBuffer
	mov	x0, x21
	bl	_BufferDescriptorGetContentLock
	bl	_LWLockRelease
	mov	x0, x21
	mov	w1, #1
	bl	_UnpinBuffer
	b	LBB0_10
LBB0_15:
	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 AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_NLocBuffer,4,2                 ; @NLocBuffer
	.comm	_BM_VALID,4,2                   ; @BM_VALID
	.comm	_BM_DIRTY,4,2                   ; @BM_DIRTY
	.comm	_local_buffer_write_error_callback,4,2 ; @local_buffer_write_error_callback
	.comm	_error_context_stack,8,3        ; @error_context_stack
	.comm	_BM_JUST_DIRTIED,4,2            ; @BM_JUST_DIRTIED
	.comm	_CurrentResourceOwner,4,2       ; @CurrentResourceOwner
	.comm	_NBuffers,4,2                   ; @NBuffers
	.comm	_LW_SHARED,4,2                  ; @LW_SHARED
.subsections_via_symbols
