	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function TerminateBufferIO
_TerminateBufferIO:                     ## @TerminateBufferIO
	.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
	movl	%edx, %r14d
	movl	%esi, %r15d
	movq	%rdi, %r12
	movq	_InProgressBuf@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	cmpq	%r12, (%rax)
	sete	%dil
	callq	_Assert
	movq	%r12, %rdi
	callq	_LockBufHdr
	movl	%eax, %ebx
	movq	_BM_IO_IN_PROGRESS@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	andl	%eax, %edi
	callq	_Assert
	movq	_BM_IO_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	orl	(%r13), %esi
	notl	%esi
	andl	%ebx, %esi
	testl	%r15d, %r15d
	je	LBB0_3
## %bb.1:
	movq	_BM_JUST_DIRTIED@GOTPCREL(%rip), %rax
	testl	%esi, (%rax)
	jne	LBB0_3
## %bb.2:
	movq	_BM_DIRTY@GOTPCREL(%rip), %rax
	movq	_BM_CHECKPOINT_NEEDED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	notl	%ecx
	andl	%ecx, %esi
LBB0_3:
	movq	_InProgressBuf@GOTPCREL(%rip), %rbx
	orl	%r14d, %esi
	movq	%r12, %rdi
	callq	_UnlockBufHdr
	movq	$0, (%rbx)
	movq	%r12, %rdi
	callq	_BufferDescriptorGetIOLock
	movl	%eax, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_LWLockRelease                  ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_InProgressBuf,8,3              ## @InProgressBuf
	.comm	_BM_IO_IN_PROGRESS,4,2          ## @BM_IO_IN_PROGRESS
	.comm	_BM_IO_ERROR,4,2                ## @BM_IO_ERROR
	.comm	_BM_JUST_DIRTIED,4,2            ## @BM_JUST_DIRTIED
	.comm	_BM_DIRTY,4,2                   ## @BM_DIRTY
	.comm	_BM_CHECKPOINT_NEEDED,4,2       ## @BM_CHECKPOINT_NEEDED
	.no_dead_strip	_TerminateBufferIO
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function TerminateBufferIO
_TerminateBufferIO:                     ; @TerminateBufferIO
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x23, _InProgressBuf@GOTPAGE
Lloh1:
	ldr	x23, [x23, _InProgressBuf@GOTPAGEOFF]
	ldr	x8, [x23]
	cmp	x8, x0
	cset	w0, eq
	bl	_Assert
	mov	x0, x19
	bl	_LockBufHdr
	mov	x22, x0
Lloh2:
	adrp	x24, _BM_IO_IN_PROGRESS@GOTPAGE
Lloh3:
	ldr	x24, [x24, _BM_IO_IN_PROGRESS@GOTPAGEOFF]
	ldr	w8, [x24]
	and	w0, w8, w0
	bl	_Assert
	ldr	w8, [x24]
Lloh4:
	adrp	x9, _BM_IO_ERROR@GOTPAGE
Lloh5:
	ldr	x9, [x9, _BM_IO_ERROR@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
	orr	w8, w9, w8
	bic	w8, w22, w8
	cbz	w21, LBB0_3
; %bb.1:
Lloh7:
	adrp	x9, _BM_JUST_DIRTIED@GOTPAGE
Lloh8:
	ldr	x9, [x9, _BM_JUST_DIRTIED@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_3
; %bb.2:
Lloh10:
	adrp	x9, _BM_DIRTY@GOTPAGE
Lloh11:
	ldr	x9, [x9, _BM_DIRTY@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
Lloh13:
	adrp	x10, _BM_CHECKPOINT_NEEDED@GOTPAGE
Lloh14:
	ldr	x10, [x10, _BM_CHECKPOINT_NEEDED@GOTPAGEOFF]
Lloh15:
	ldr	w10, [x10]
	orr	w9, w10, w9
	bic	w8, w8, w9
LBB0_3:
	orr	w1, w8, w20
	mov	x0, x19
	bl	_UnlockBufHdr
	str	xzr, [x23]
	mov	x0, x19
	bl	_BufferDescriptorGetIOLock
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_LWLockRelease
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_InProgressBuf,8,3              ; @InProgressBuf
	.comm	_BM_IO_IN_PROGRESS,4,2          ; @BM_IO_IN_PROGRESS
	.comm	_BM_IO_ERROR,4,2                ; @BM_IO_ERROR
	.comm	_BM_JUST_DIRTIED,4,2            ; @BM_JUST_DIRTIED
	.comm	_BM_DIRTY,4,2                   ; @BM_DIRTY
	.comm	_BM_CHECKPOINT_NEEDED,4,2       ; @BM_CHECKPOINT_NEEDED
	.no_dead_strip	_TerminateBufferIO
.subsections_via_symbols
