	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_MarkBufferDirty                ## -- Begin function MarkBufferDirty
	.p2align	4, 0x90
_MarkBufferDirty:                       ## @MarkBufferDirty
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	callq	_BufferIsValid
	testl	%eax, %eax
	jne	LBB0_2
## %bb.1:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdx
	callq	_elog
LBB0_2:
	movq	%rbx, %rdi
	callq	_BufferIsLocal
	testq	%rax, %rax
	je	LBB0_3
## %bb.11:
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_MarkLocalBufferDirty           ## TAILCALL
LBB0_3:
	leaq	-1(%rbx), %rdi
	callq	_GetBufferDescriptor
	movq	%rax, %r15
	movq	%rbx, %rdi
	callq	_BufferIsPinned
	movl	%eax, %edi
	callq	_Assert
	movq	%r15, %rdi
	callq	_BufferDescriptorGetContentLock
	movq	_LW_EXCLUSIVE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_LWLockHeldByMeInMode
	movl	%eax, %edi
	callq	_Assert
	movq	%r15, %rdi
	callq	_pg_atomic_read_u32
	movl	%eax, %ebx
	movl	%eax, -44(%rbp)
	movq	_BM_DIRTY@GOTPCREL(%rip), %r12
	movq	_BM_JUST_DIRTIED@GOTPCREL(%rip), %r13
	leaq	-44(%rbp), %r14
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	%ebx, %edi
	callq	_BUF_STATE_GET_REFCOUNT
	xorl	%edi, %edi
	testq	%rax, %rax
	setg	%dil
	callq	_Assert
	orl	(%r12), %ebx
	orl	(%r13), %ebx
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	%ebx, %edx
	callq	_pg_atomic_compare_exchange_u32
	movl	-44(%rbp), %ebx
	testq	%rax, %rax
	jne	LBB0_7
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	_BM_LOCKED@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r15, %rdi
	callq	_WaitBufHdrUnlocked
	movl	%eax, %ebx
	movl	%eax, -44(%rbp)
	jmp	LBB0_6
LBB0_7:
	testl	%ebx, (%r12)
	jne	LBB0_10
## %bb.8:
	movq	_VacuumPageDirty@GOTPCREL(%rip), %rax
	incl	(%rax)
	movq	_pgBufferUsage@GOTPCREL(%rip), %rax
	incl	(%rax)
	movq	_VacuumCostActive@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_10
## %bb.9:
	movq	_VacuumCostPageDirty@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_VacuumCostBalance@GOTPCREL(%rip), %rcx
	addl	%eax, (%rcx)
LBB0_10:
	addq	$8, %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	"bad buffer ID: %d"

	.comm	_LW_EXCLUSIVE,4,2               ## @LW_EXCLUSIVE
	.comm	_BM_LOCKED,4,2                  ## @BM_LOCKED
	.comm	_BM_DIRTY,4,2                   ## @BM_DIRTY
	.comm	_BM_JUST_DIRTIED,4,2            ## @BM_JUST_DIRTIED
	.comm	_VacuumPageDirty,4,2            ## @VacuumPageDirty
	.comm	_pgBufferUsage,4,2              ## @pgBufferUsage
	.comm	_VacuumCostActive,8,3           ## @VacuumCostActive
	.comm	_VacuumCostPageDirty,8,3        ## @VacuumCostPageDirty
	.comm	_VacuumCostBalance,4,2          ## @VacuumCostBalance
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_MarkBufferDirty                ; -- Begin function MarkBufferDirty
	.p2align	2
_MarkBufferDirty:                       ; @MarkBufferDirty
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x20, x0
	bl	_BufferIsValid
	cbnz	w0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _ERROR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_elog
LBB0_2:
	mov	x0, x20
	bl	_BufferIsLocal
	cbz	x0, LBB0_4
; %bb.3:
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	b	_MarkLocalBufferDirty
LBB0_4:
	sub	x0, x20, #1
	bl	_GetBufferDescriptor
	mov	x19, x0
	mov	x0, x20
	bl	_BufferIsPinned
	bl	_Assert
	mov	x0, x19
	bl	_BufferDescriptorGetContentLock
Lloh5:
	adrp	x8, _LW_EXCLUSIVE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _LW_EXCLUSIVE@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	bl	_LWLockHeldByMeInMode
	bl	_Assert
	mov	x0, x19
	bl	_pg_atomic_read_u32
	mov	x20, x0
	str	w0, [sp, #12]
Lloh8:
	adrp	x22, _BM_LOCKED@GOTPAGE
Lloh9:
	ldr	x22, [x22, _BM_LOCKED@GOTPAGEOFF]
Lloh10:
	adrp	x21, _BM_DIRTY@GOTPAGE
Lloh11:
	ldr	x21, [x21, _BM_DIRTY@GOTPAGEOFF]
Lloh12:
	adrp	x23, _BM_JUST_DIRTIED@GOTPAGE
Lloh13:
	ldr	x23, [x23, _BM_JUST_DIRTIED@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x20
	bl	_BUF_STATE_GET_REFCOUNT
	cmp	x0, #0
	cset	w0, gt
	bl	_Assert
	ldr	w8, [x21]
	ldr	w9, [x23]
	orr	w8, w8, w20
	orr	w2, w8, w9
	add	x1, sp, #12
	mov	x0, x19
	bl	_pg_atomic_compare_exchange_u32
	ldr	w20, [sp, #12]
	cbnz	x0, LBB0_8
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x22]
	tst	w8, w20
	b.eq	LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x19
	bl	_WaitBufHdrUnlocked
	mov	x20, x0
	str	w0, [sp, #12]
	b	LBB0_5
LBB0_8:
	ldr	w8, [x21]
	tst	w8, w20
	b.ne	LBB0_11
; %bb.9:
Lloh14:
	adrp	x8, _VacuumPageDirty@GOTPAGE
Lloh15:
	ldr	x8, [x8, _VacuumPageDirty@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
Lloh16:
	adrp	x8, _pgBufferUsage@GOTPAGE
Lloh17:
	ldr	x8, [x8, _pgBufferUsage@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
Lloh18:
	adrp	x8, _VacuumCostActive@GOTPAGE
Lloh19:
	ldr	x8, [x8, _VacuumCostActive@GOTPAGEOFF]
Lloh20:
	ldr	x8, [x8]
	cbz	x8, LBB0_11
; %bb.10:
Lloh21:
	adrp	x8, _VacuumCostPageDirty@GOTPAGE
Lloh22:
	ldr	x8, [x8, _VacuumCostPageDirty@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
Lloh24:
	adrp	x9, _VacuumCostBalance@GOTPAGE
Lloh25:
	ldr	x9, [x9, _VacuumCostBalance@GOTPAGEOFF]
	ldr	w10, [x9]
	add	w8, w10, w8
	str	w8, [x9]
LBB0_11:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_ERROR,4,2                      ; @ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bad buffer ID: %d"

	.comm	_LW_EXCLUSIVE,4,2               ; @LW_EXCLUSIVE
	.comm	_BM_LOCKED,4,2                  ; @BM_LOCKED
	.comm	_BM_DIRTY,4,2                   ; @BM_DIRTY
	.comm	_BM_JUST_DIRTIED,4,2            ; @BM_JUST_DIRTIED
	.comm	_VacuumPageDirty,4,2            ; @VacuumPageDirty
	.comm	_pgBufferUsage,4,2              ; @pgBufferUsage
	.comm	_VacuumCostActive,8,3           ; @VacuumCostActive
	.comm	_VacuumCostPageDirty,8,3        ; @VacuumCostPageDirty
	.comm	_VacuumCostBalance,4,2          ; @VacuumCostBalance
.subsections_via_symbols
