	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function SyncOneBuffer
_SyncOneBuffer:                         ## @SyncOneBuffer
	.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	%rdx, %r14
	movl	%esi, %r13d
	callq	_GetBufferDescriptor
	movq	%rax, %r12
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_ReservePrivateRefCountEntry
	movq	%r12, %rdi
	callq	_LockBufHdr
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_BUF_STATE_GET_REFCOUNT
	testq	%rax, %rax
	jne	LBB0_6
## %bb.1:
	movl	%ebx, %edi
	callq	_BUF_STATE_GET_USAGECOUNT
	testq	%rax, %rax
	je	LBB0_2
LBB0_6:
	testl	%r13d, %r13d
	je	LBB0_3
## %bb.7:
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_UnlockBufHdr
	xorl	%r15d, %r15d
	jmp	LBB0_9
LBB0_2:
	movq	_BUF_REUSABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
LBB0_3:
	movq	_BM_VALID@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_5
## %bb.4:
	movq	_BM_DIRTY@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_5
## %bb.8:
	movq	%r12, %rdi
	callq	_PinBuffer_Locked
	movq	%r12, %rdi
	callq	_BufferDescriptorGetContentLock
	movq	_LW_SHARED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_LWLockAcquire
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_FlushBuffer
	movq	%r12, %rdi
	callq	_BufferDescriptorGetContentLock
	movl	%eax, %edi
	callq	_LWLockRelease
	movl	(%r12), %eax
	movl	%eax, -44(%rbp)
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_UnpinBuffer
	leaq	-44(%rbp), %rsi
	movq	%r14, %rdi
	callq	_ScheduleBufferTagForWriteback
	movq	_BUF_WRITTEN@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
	jmp	LBB0_9
LBB0_5:
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_UnlockBufHdr
LBB0_9:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BUF_REUSABLE,4,2               ## @BUF_REUSABLE
	.comm	_BM_VALID,4,2                   ## @BM_VALID
	.comm	_BM_DIRTY,4,2                   ## @BM_DIRTY
	.comm	_LW_SHARED,4,2                  ## @LW_SHARED
	.comm	_BUF_WRITTEN,4,2                ## @BUF_WRITTEN
	.no_dead_strip	_SyncOneBuffer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function SyncOneBuffer
_SyncOneBuffer:                         ; @SyncOneBuffer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x2
	mov	x21, x1
	bl	_GetBufferDescriptor
	mov	x20, x0
	bl	_ReservePrivateRefCountEntry
	mov	x0, x20
	bl	_LockBufHdr
	mov	x22, x0
	bl	_BUF_STATE_GET_REFCOUNT
	cbnz	x0, LBB0_2
; %bb.1:
	mov	x0, x22
	bl	_BUF_STATE_GET_USAGECOUNT
	cbz	x0, LBB0_4
LBB0_2:
	cbz	w21, LBB0_5
; %bb.3:
	mov	x0, x20
	mov	x1, x22
	bl	_UnlockBufHdr
	mov	w21, #0
	b	LBB0_9
LBB0_4:
Lloh0:
	adrp	x8, _BUF_REUSABLE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BUF_REUSABLE@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
LBB0_5:
Lloh3:
	adrp	x8, _BM_VALID@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BM_VALID@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w22
	b.eq	LBB0_8
; %bb.6:
Lloh6:
	adrp	x8, _BM_DIRTY@GOTPAGE
Lloh7:
	ldr	x8, [x8, _BM_DIRTY@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	tst	w8, w22
	b.eq	LBB0_8
; %bb.7:
	mov	x0, x20
	bl	_PinBuffer_Locked
	mov	x0, x20
	bl	_BufferDescriptorGetContentLock
Lloh9:
	adrp	x8, _LW_SHARED@GOTPAGE
Lloh10:
	ldr	x8, [x8, _LW_SHARED@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	bl	_LWLockAcquire
	mov	x0, x20
	mov	x1, #0
	bl	_FlushBuffer
	mov	x0, x20
	bl	_BufferDescriptorGetContentLock
	bl	_LWLockRelease
	ldr	w8, [x20]
	str	w8, [sp, #12]
	mov	x0, x20
	mov	w1, #1
	bl	_UnpinBuffer
	add	x1, sp, #12
	mov	x0, x19
	bl	_ScheduleBufferTagForWriteback
Lloh12:
	adrp	x8, _BUF_WRITTEN@GOTPAGE
Lloh13:
	ldr	x8, [x8, _BUF_WRITTEN@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	orr	w21, w8, w21
	b	LBB0_9
LBB0_8:
	mov	x0, x20
	mov	x1, x22
	bl	_UnlockBufHdr
LBB0_9:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_BUF_REUSABLE,4,2               ; @BUF_REUSABLE
	.comm	_BM_VALID,4,2                   ; @BM_VALID
	.comm	_BM_DIRTY,4,2                   ; @BM_DIRTY
	.comm	_LW_SHARED,4,2                  ; @LW_SHARED
	.comm	_BUF_WRITTEN,4,2                ; @BUF_WRITTEN
	.no_dead_strip	_SyncOneBuffer
.subsections_via_symbols
