	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __check_watermark
___check_watermark:                     ## @__check_watermark
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	leaq	-48(%rbp), %rsi
	leaq	-40(%rbp), %rdx
	callq	___get_memory_limit
	movq	(%rbx), %rcx
	movq	_LIST_CLEAN@GOTPCREL(%rip), %r15
	movq	(%r15), %rdx
	movq	_LIST_DIRTY@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rax
	movq	(%rcx,%rax,8), %rax
	movq	(%rcx,%rdx,8), %rcx
	addq	%rax, %rcx
	cmpq	-40(%rbp), %rcx
	jbe	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%rbx, %rdi
	callq	___get_unclaimed_buffer
	testq	%rax, %rax
	je	LBB0_6
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%rax, %rdi
	callq	___free_buffer_wake
	xorl	%eax, %eax
	callq	_dm_bufio_cond_resched
	movq	(%rbx), %rcx
	movq	(%r15), %rdx
	jmp	LBB0_1
LBB0_4:
	cmpq	-48(%rbp), %rax
	jbe	LBB0_6
## %bb.5:
	movq	%rbx, %rdi
	movl	$1, %esi
	movq	%r14, %rdx
	callq	___write_dirty_buffers_async
LBB0_6:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LIST_CLEAN,8,3                 ## @LIST_CLEAN
	.comm	_LIST_DIRTY,8,3                 ## @LIST_DIRTY
	.no_dead_strip	___check_watermark
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __check_watermark
___check_watermark:                     ; @__check_watermark
	.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, x1
	mov	x20, x0
	add	x1, sp, #8
	mov	x2, sp
	bl	___get_memory_limit
Lloh0:
	adrp	x21, _LIST_CLEAN@GOTPAGE
Lloh1:
	ldr	x21, [x21, _LIST_CLEAN@GOTPAGEOFF]
	ldr	x8, [x20]
	ldr	x9, [x21]
	ldr	x9, [x8, x9, lsl #3]
Lloh2:
	adrp	x22, _LIST_DIRTY@GOTPAGE
Lloh3:
	ldr	x22, [x22, _LIST_DIRTY@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x22]
	ldr	x8, [x8, x10, lsl #3]
	ldr	x10, [sp]
	add	x9, x8, x9
	cmp	x9, x10
	b.ls	LBB0_4
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x20
	bl	___get_unclaimed_buffer
	cbz	x0, LBB0_6
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	bl	___free_buffer_wake
	bl	_dm_bufio_cond_resched
	ldr	x8, [x20]
	ldr	x9, [x21]
	ldr	x9, [x8, x9, lsl #3]
	b	LBB0_1
LBB0_4:
	ldr	x9, [sp, #8]
	cmp	x8, x9
	b.ls	LBB0_6
; %bb.5:
	mov	x0, x20
	mov	w1, #1
	mov	x2, x19
	bl	___write_dirty_buffers_async
LBB0_6:
	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 AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_LIST_CLEAN,8,3                 ; @LIST_CLEAN
	.comm	_LIST_DIRTY,8,3                 ; @LIST_DIRTY
	.no_dead_strip	___check_watermark
.subsections_via_symbols
