	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_md_bitmap_endwrite             ## -- Begin function md_bitmap_endwrite
	.p2align	4, 0x90
_md_bitmap_endwrite:                    ## @md_bitmap_endwrite
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	testq	%rdi, %rdi
	je	LBB0_20
## %bb.1:
	movq	%rdx, %rbx
	movq	%rsi, %r15
	movq	%rdi, %r12
	testl	%r8d, %r8d
	je	LBB0_5
## %bb.2:
	leaq	40(%r12), %r14
	movq	%r14, %rdi
	callq	_atomic_dec_and_test
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	leaq	44(%r12), %rdi
	callq	_wake_up
LBB0_4:
	movq	%r14, %rdi
	callq	_atomic_read
	movq	32(%r12), %rcx
	movl	12(%rcx), %edx
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_pr_debug
LBB0_5:
	testq	%rbx, %rbx
	je	LBB0_20
## %bb.6:
	leaq	12(%r12), %r13
	leaq	24(%r12), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	%r13, %rdi
	callq	_spin_unlock_irqrestore
	movq	-64(%rbp), %rax
	addq	%rax, %r15
	movl	$0, %ecx
	subq	%rax, %rbx
	cmovbq	%rcx, %rbx
	jbe	LBB0_20
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	callq	_spin_lock_irqsave
	movq	%r13, %rdi
	movq	%r15, %rsi
	leaq	-64(%rbp), %rdx
	xorl	%ecx, %ecx
	callq	_md_bitmap_get_counter
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	%rax, %r14
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_13
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	32(%r12), %rax
	cmpl	$0, 8(%rax)
	jne	LBB0_15
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	(%rax), %rax
	cmpq	%rax, (%r12)
	jge	LBB0_15
## %bb.12:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	%rax, (%r12)
	movl	$1, 8(%r12)
	movl	28(%r12), %edi
	callq	_sysfs_notify_dirent_safe
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_7 Depth=1
	movl	(%r14), %edi
	callq	_NEEDED
	testl	%eax, %eax
	jne	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	_NEEDED_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r14)
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_7 Depth=1
	movl	(%r14), %edi
	callq	_COUNTER
	movq	_COUNTER_MAX@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_wake_up
LBB0_17:                                ##   in Loop: Header=BB0_7 Depth=1
	movl	(%r14), %eax
	leal	-1(%rax), %ecx
	movl	%ecx, (%r14)
	cmpl	$3, %eax
	jg	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_md_bitmap_set_pending
	movq	$0, 16(%r12)
	jmp	LBB0_19
LBB0_8:
	movq	%r13, %rdi
	callq	_spin_unlock_irqrestore
LBB0_20:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"dec write-behind count %d/%lu\n"

	.comm	_NEEDED_MASK,4,2                ## @NEEDED_MASK
	.comm	_COUNTER_MAX,8,3                ## @COUNTER_MAX
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_md_bitmap_endwrite             ; -- Begin function md_bitmap_endwrite
	.p2align	2
_md_bitmap_endwrite:                    ; @md_bitmap_endwrite
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	cbz	x0, LBB0_20
; %bb.1:
	mov	x19, x3
	mov	x22, x2
	mov	x20, x1
	mov	x21, x0
	cbz	w4, LBB0_5
; %bb.2:
	add	x23, x21, #40
	mov	x0, x23
	bl	_atomic_dec_and_test
	cbz	x0, LBB0_4
; %bb.3:
	add	x0, x21, #44
	bl	_wake_up
LBB0_4:
	mov	x0, x23
	bl	_atomic_read
	mov	x1, x0
	ldr	x8, [x21, #32]
	ldr	w2, [x8, #12]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_debug
LBB0_5:
	cbz	x22, LBB0_20
; %bb.6:
	add	x23, x21, #12
	add	x24, x21, #24
Lloh2:
	adrp	x26, _NEEDED_MASK@GOTPAGE
Lloh3:
	ldr	x26, [x26, _NEEDED_MASK@GOTPAGEOFF]
Lloh4:
	adrp	x27, _COUNTER_MAX@GOTPAGE
Lloh5:
	ldr	x27, [x27, _COUNTER_MAX@GOTPAGEOFF]
	mov	w28, #1
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x23
	bl	_spin_unlock_irqrestore
	ldr	x8, [sp, #8]
	add	x20, x8, x20
	subs	x8, x22, x8
	csel	x22, xzr, x8, lo
	b.ls	LBB0_20
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x23
	bl	_spin_lock_irqsave
	add	x2, sp, #8
	mov	x0, x23
	mov	x1, x20
	mov	w3, #0
	bl	_md_bitmap_get_counter
	cbz	x0, LBB0_19
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	x25, x0
	cbz	w19, LBB0_13
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	x8, [x21, #32]
	ldr	w9, [x8, #8]
	cbnz	w9, LBB0_15
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	x9, [x21]
	ldr	x8, [x8]
	cmp	x9, x8
	b.ge	LBB0_15
; %bb.12:                               ;   in Loop: Header=BB0_8 Depth=1
	str	x8, [x21]
	str	w28, [x21, #8]
	ldr	w0, [x21, #28]
	bl	_sysfs_notify_dirent_safe
	b	LBB0_15
LBB0_13:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	w0, [x25]
	bl	_NEEDED
	cbnz	w0, LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	w8, [x26]
	ldr	w9, [x25]
	orr	w8, w9, w8
	str	w8, [x25]
LBB0_15:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	w0, [x25]
	bl	_COUNTER
	ldr	x8, [x27]
	cmp	x0, x8
	b.ne	LBB0_17
; %bb.16:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x24
	bl	_wake_up
LBB0_17:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	w8, [x25]
	sub	w9, w8, #1
	str	w9, [x25]
	cmp	w8, #3
	b.gt	LBB0_7
; %bb.18:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x23
	mov	x1, x20
	bl	_md_bitmap_set_pending
	str	xzr, [x21, #16]
	b	LBB0_7
LBB0_19:
	mov	x0, x23
	bl	_spin_unlock_irqrestore
LBB0_20:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"dec write-behind count %d/%lu\n"

	.comm	_NEEDED_MASK,4,2                ; @NEEDED_MASK
	.comm	_COUNTER_MAX,8,3                ; @COUNTER_MAX
.subsections_via_symbols
