	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ffs_bufwrite
_ffs_bufwrite:                          ## @ffs_bufwrite
	.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
	movq	_KTR_BUF@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%rbx), %r8d
	movl	32(%rbx), %ecx
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdx
	callq	_CTR3
	movq	_B_INVAL@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	testl	%eax, (%rbx)
	je	LBB0_3
## %bb.1:
	movq	%rbx, %rdi
	callq	_brelse
LBB0_2:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%rbx, %rdi
	callq	_BUF_ISLOCKED
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:
	leaq	L_.str.1(%rip), %rdi
	callq	_panic
LBB0_5:
	movl	60(%rbx), %edi
	callq	_BO_LOCK
	movl	4(%rbx), %eax
	movq	_BV_BKGRDINPROG@GOTPCREL(%rip), %r12
	testl	%eax, (%r12)
	je	LBB0_10
## %bb.6:
	movq	_B_ASYNC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rbx)
	je	LBB0_8
## %bb.7:
	movl	60(%rbx), %edi
	callq	_BO_UNLOCK
	movq	%rbx, %rdi
	callq	_bdwrite
	jmp	LBB0_2
LBB0_8:
	movq	_BV_BKGRDWAIT@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, 4(%rbx)
	leaq	8(%rbx), %r14
	movl	60(%rbx), %edi
	callq	_BO_LOCKPTR
	movq	_PRIBIO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	leaq	L_.str.2(%rip), %rcx
	movq	%r14, %rdi
	movl	%eax, %esi
	xorl	%r8d, %r8d
	callq	_msleep
	movl	4(%rbx), %eax
	testl	%eax, (%r12)
	je	LBB0_10
## %bb.9:
	leaq	L_.str.3(%rip), %rdi
	callq	_panic
	movl	4(%rbx), %eax
LBB0_10:
	movq	_BV_BKGRDERR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	andl	%eax, %ecx
	movl	%ecx, 4(%rbx)
	movl	60(%rbx), %edi
	callq	_BO_UNLOCK
	movq	_dobkgrdwrite@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_19
## %bb.11:
	movq	_BX_BKGRDWRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%rbx)
	je	LBB0_19
## %bb.12:
	movq	_B_ASYNC@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	testl	%eax, (%rbx)
	je	LBB0_19
## %bb.13:
	xorl	%eax, %eax
	callq	_vm_page_count_severe
	testl	%eax, %eax
	jne	LBB0_19
## %bb.14:
	xorl	%eax, %eax
	callq	_buf_dirty_count_severe
	testl	%eax, %eax
	je	LBB0_15
LBB0_19:
	movq	%rbx, %rdi
	callq	_bundirty
LBB0_20:
	movq	_BX_CYLGRP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%rbx)
	je	LBB0_22
## %bb.21:
	movq	16(%rbx), %rax
	movq	_time_second@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, (%rax)
	movl	%ecx, 4(%rax)
LBB0_22:
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_bufwrite                       ## TAILCALL
LBB0_15:
	movq	40(%rbx), %rsi
	xorl	%edi, %edi
	testq	%rsi, %rsi
	sete	%dil
	callq	_KASSERT
	movl	64(%rbx), %edi
	movq	_GB_NOWAIT_BD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_geteblk
	testq	%rax, %rax
	je	LBB0_20
## %bb.16:
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_buf_mapped
	leaq	L_.str.5(%rip), %rsi
	movl	%eax, %edi
	callq	_KASSERT
	movq	16(%r14), %rdi
	movq	16(%rbx), %rsi
	movl	64(%rbx), %edx
	callq	_memcpy
	movl	60(%rbx), %edi
	callq	_BO_LOCK
	movl	(%r12), %eax
	orl	%eax, 4(%rbx)
	movl	60(%rbx), %edi
	callq	_BO_UNLOCK
	movq	_BX_FSPRIV@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	8(%rbx), %eax
	movq	_BX_BKGRDMARKER@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	orl	%eax, 8(%r14)
	movl	56(%rbx), %eax
	movl	%eax, 56(%r14)
	movl	52(%rbx), %eax
	movl	%eax, 52(%r14)
	movl	48(%rbx), %eax
	movl	%eax, 48(%r14)
	movq	_ffs_backgroundwritedone@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 40(%r14)
	movl	(%r14), %eax
	orl	(%r13), %eax
	movl	%eax, (%r14)
	movl	(%r15), %ecx
	notl	%ecx
	andl	%eax, %ecx
	movl	%ecx, (%r14)
	movl	32(%rbx), %edi
	movq	%r14, %rsi
	callq	_pbgetvp
	movq	%rbx, %rdi
	callq	_bundirty
	movq	_BX_CYLGRP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%rbx)
	je	LBB0_18
## %bb.17:
	movq	16(%rbx), %r15
	movl	$0, 8(%r15)
	movl	24(%rbx), %edx
	movq	$-1, %rdi
	movq	%r15, %rsi
	callq	_calculate_crc32c
	movl	%eax, 8(%r15)
LBB0_18:
	movq	%rbx, %rdi
	callq	_bqrelse
	movq	%r14, %rbx
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.comm	_KTR_BUF,4,2                    ## @KTR_BUF
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bufwrite(%p) vp %p flags %X"

	.comm	_B_INVAL,4,2                    ## @B_INVAL
L_.str.1:                               ## @.str.1
	.asciz	"bufwrite: buffer is not busy???"

	.comm	_BV_BKGRDINPROG,4,2             ## @BV_BKGRDINPROG
	.comm	_B_ASYNC,4,2                    ## @B_ASYNC
	.comm	_BV_BKGRDWAIT,4,2               ## @BV_BKGRDWAIT
	.comm	_PRIBIO,4,2                     ## @PRIBIO
L_.str.2:                               ## @.str.2
	.asciz	"bwrbg"

L_.str.3:                               ## @.str.3
	.asciz	"bufwrite: still writing"

	.comm	_BV_BKGRDERR,4,2                ## @BV_BKGRDERR
	.comm	_dobkgrdwrite,8,3               ## @dobkgrdwrite
	.comm	_BX_BKGRDWRITE,4,2              ## @BX_BKGRDWRITE
	.comm	_GB_NOWAIT_BD,4,2               ## @GB_NOWAIT_BD
L_.str.5:                               ## @.str.5
	.asciz	"Unmapped cg"

	.comm	_BX_FSPRIV,4,2                  ## @BX_FSPRIV
	.comm	_BX_BKGRDMARKER,4,2             ## @BX_BKGRDMARKER
	.comm	_ffs_backgroundwritedone,8,3    ## @ffs_backgroundwritedone
	.comm	_BX_CYLGRP,4,2                  ## @BX_CYLGRP
	.comm	_time_second,4,2                ## @time_second
	.no_dead_strip	_ffs_bufwrite
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ffs_bufwrite
_ffs_bufwrite:                          ; @ffs_bufwrite
	.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	x19, x0
Lloh0:
	adrp	x8, _KTR_BUF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _KTR_BUF@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	ldr	w3, [x19, #32]
	ldr	w4, [x19]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	bl	_CTR3
	ldr	w8, [x19]
Lloh5:
	adrp	x21, _B_INVAL@GOTPAGE
Lloh6:
	ldr	x21, [x21, _B_INVAL@GOTPAGEOFF]
	ldr	w9, [x21]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.1:
	mov	x0, x19
	bl	_brelse
LBB0_2:
	mov	w0, #0
	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
	ret
LBB0_3:
	mov	x0, x19
	bl	_BUF_ISLOCKED
	cbnz	w0, LBB0_5
; %bb.4:
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_panic
LBB0_5:
	ldr	w0, [x19, #60]
	bl	_BO_LOCK
	ldr	w8, [x19, #4]
Lloh9:
	adrp	x23, _BV_BKGRDINPROG@GOTPAGE
Lloh10:
	ldr	x23, [x23, _BV_BKGRDINPROG@GOTPAGEOFF]
	ldr	w9, [x23]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.6:
	ldr	w9, [x19]
Lloh11:
	adrp	x10, _B_ASYNC@GOTPAGE
Lloh12:
	ldr	x10, [x10, _B_ASYNC@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_8
; %bb.7:
	ldr	w0, [x19, #60]
	bl	_BO_UNLOCK
	mov	x0, x19
	bl	_bdwrite
	b	LBB0_2
LBB0_8:
Lloh14:
	adrp	x9, _BV_BKGRDWAIT@GOTPAGE
Lloh15:
	ldr	x9, [x9, _BV_BKGRDWAIT@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x19, #4]
	add	x20, x19, #8
	ldr	w0, [x19, #60]
	bl	_BO_LOCKPTR
	mov	x1, x0
Lloh17:
	adrp	x8, _PRIBIO@GOTPAGE
Lloh18:
	ldr	x8, [x8, _PRIBIO@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
Lloh20:
	adrp	x3, l_.str.2@PAGE
Lloh21:
	add	x3, x3, l_.str.2@PAGEOFF
	mov	x0, x20
	mov	w4, #0
	bl	_msleep
	ldr	w8, [x19, #4]
	ldr	w9, [x23]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.9:
Lloh22:
	adrp	x0, l_.str.3@PAGE
Lloh23:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_panic
	ldr	w8, [x19, #4]
LBB0_10:
Lloh24:
	adrp	x9, _BV_BKGRDERR@GOTPAGE
Lloh25:
	ldr	x9, [x9, _BV_BKGRDERR@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	bic	w8, w8, w9
	str	w8, [x19, #4]
	ldr	w0, [x19, #60]
	bl	_BO_UNLOCK
Lloh27:
	adrp	x8, _dobkgrdwrite@GOTPAGE
Lloh28:
	ldr	x8, [x8, _dobkgrdwrite@GOTPAGEOFF]
Lloh29:
	ldr	x8, [x8]
Lloh30:
	adrp	x22, _BX_CYLGRP@GOTPAGE
Lloh31:
	ldr	x22, [x22, _BX_CYLGRP@GOTPAGEOFF]
	cbz	x8, LBB0_15
; %bb.11:
	ldr	w8, [x19, #8]
Lloh32:
	adrp	x9, _BX_BKGRDWRITE@GOTPAGE
Lloh33:
	ldr	x9, [x9, _BX_BKGRDWRITE@GOTPAGEOFF]
Lloh34:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_15
; %bb.12:
	ldr	w8, [x19]
Lloh35:
	adrp	x24, _B_ASYNC@GOTPAGE
Lloh36:
	ldr	x24, [x24, _B_ASYNC@GOTPAGEOFF]
	ldr	w9, [x24]
	tst	w9, w8
	b.eq	LBB0_15
; %bb.13:
	bl	_vm_page_count_severe
	cbnz	w0, LBB0_15
; %bb.14:
	bl	_buf_dirty_count_severe
	cbz	w0, LBB0_19
LBB0_15:
	mov	x0, x19
	bl	_bundirty
LBB0_16:
	ldr	w8, [x19, #8]
	ldr	w9, [x22]
	tst	w9, w8
	b.eq	LBB0_18
; %bb.17:
	ldr	x8, [x19, #16]
Lloh37:
	adrp	x9, _time_second@GOTPAGE
Lloh38:
	ldr	x9, [x9, _time_second@GOTPAGEOFF]
Lloh39:
	ldr	w9, [x9]
	stp	w9, w9, [x8]
LBB0_18:
	mov	x0, x19
	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	_bufwrite
LBB0_19:
	ldr	x1, [x19, #40]
	cmp	x1, #0
	cset	w0, eq
	bl	_KASSERT
	ldr	w0, [x19, #64]
Lloh40:
	adrp	x8, _GB_NOWAIT_BD@GOTPAGE
Lloh41:
	ldr	x8, [x8, _GB_NOWAIT_BD@GOTPAGEOFF]
Lloh42:
	ldr	w1, [x8]
	bl	_geteblk
	cbz	x0, LBB0_16
; %bb.20:
	mov	x20, x0
	mov	x0, x19
	bl	_buf_mapped
Lloh43:
	adrp	x1, l_.str.5@PAGE
Lloh44:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_KASSERT
	ldr	x0, [x20, #16]
	ldr	x1, [x19, #16]
	ldr	w2, [x19, #64]
	bl	_memcpy
	ldr	w0, [x19, #60]
	bl	_BO_LOCK
	ldr	w8, [x23]
	ldr	w9, [x19, #4]
	orr	w8, w9, w8
	str	w8, [x19, #4]
	ldr	w0, [x19, #60]
	bl	_BO_UNLOCK
	ldr	w8, [x19, #8]
Lloh45:
	adrp	x9, _BX_FSPRIV@GOTPAGE
Lloh46:
	ldr	x9, [x9, _BX_FSPRIV@GOTPAGEOFF]
Lloh47:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh48:
	adrp	x9, _BX_BKGRDMARKER@GOTPAGE
Lloh49:
	ldr	x9, [x9, _BX_BKGRDMARKER@GOTPAGEOFF]
Lloh50:
	ldr	w9, [x9]
	orr	w8, w8, w9
	ldr	w9, [x20, #8]
	orr	w8, w8, w9
	str	w8, [x20, #8]
	ldr	w8, [x19, #56]
	str	w8, [x20, #56]
	ldr	d0, [x19, #48]
	str	d0, [x20, #48]
Lloh51:
	adrp	x8, _ffs_backgroundwritedone@GOTPAGE
Lloh52:
	ldr	x8, [x8, _ffs_backgroundwritedone@GOTPAGEOFF]
Lloh53:
	ldr	x8, [x8]
	str	x8, [x20, #40]
	ldr	w8, [x24]
	ldr	w9, [x20]
	orr	w8, w9, w8
	str	w8, [x20]
	ldr	w9, [x21]
	bic	w8, w8, w9
	str	w8, [x20]
	ldr	w0, [x19, #32]
	mov	x1, x20
	bl	_pbgetvp
	mov	x0, x19
	bl	_bundirty
	ldr	w8, [x19, #8]
	ldr	w9, [x22]
	tst	w9, w8
	b.eq	LBB0_22
; %bb.21:
	ldr	x21, [x19, #16]
	str	wzr, [x21, #8]
	ldr	w2, [x19, #24]
	mov	x0, #-1
	mov	x1, x21
	bl	_calculate_crc32c
	str	w0, [x21, #8]
LBB0_22:
	mov	x0, x19
	bl	_bqrelse
	mov	x19, x20
	b	LBB0_16
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpAdd	Lloh43, Lloh44
	.cfi_endproc
                                        ; -- End function
	.comm	_KTR_BUF,4,2                    ; @KTR_BUF
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bufwrite(%p) vp %p flags %X"

	.comm	_B_INVAL,4,2                    ; @B_INVAL
l_.str.1:                               ; @.str.1
	.asciz	"bufwrite: buffer is not busy???"

	.comm	_BV_BKGRDINPROG,4,2             ; @BV_BKGRDINPROG
	.comm	_B_ASYNC,4,2                    ; @B_ASYNC
	.comm	_BV_BKGRDWAIT,4,2               ; @BV_BKGRDWAIT
	.comm	_PRIBIO,4,2                     ; @PRIBIO
l_.str.2:                               ; @.str.2
	.asciz	"bwrbg"

l_.str.3:                               ; @.str.3
	.asciz	"bufwrite: still writing"

	.comm	_BV_BKGRDERR,4,2                ; @BV_BKGRDERR
	.comm	_dobkgrdwrite,8,3               ; @dobkgrdwrite
	.comm	_BX_BKGRDWRITE,4,2              ; @BX_BKGRDWRITE
	.comm	_GB_NOWAIT_BD,4,2               ; @GB_NOWAIT_BD
l_.str.5:                               ; @.str.5
	.asciz	"Unmapped cg"

	.comm	_BX_FSPRIV,4,2                  ; @BX_FSPRIV
	.comm	_BX_BKGRDMARKER,4,2             ; @BX_BKGRDMARKER
	.comm	_ffs_backgroundwritedone,8,3    ; @ffs_backgroundwritedone
	.comm	_BX_CYLGRP,4,2                  ; @BX_CYLGRP
	.comm	_time_second,4,2                ; @time_second
	.no_dead_strip	_ffs_bufwrite
.subsections_via_symbols
