	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function end_sync_write
_end_sync_write:                        ## @end_sync_write
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	_BIO_UPTODATE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	8(%rbx), %rsi
	callq	_test_bit
	movl	%eax, %r14d
	movq	(%rbx), %r15
	movq	32(%r15), %r13
	movq	8(%r13), %r12
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_find_bio_disk
	testl	%r14d, %r14d
	je	LBB0_1
## %bb.6:
	movq	(%r12), %rdx
	movslq	%eax, %rcx
	movq	(%rdx,%rcx,8), %rdi
	movq	(%r15), %rdx
	movq	24(%r15), %rsi
	leaq	-48(%rbp), %rcx
	leaq	-60(%rbp), %r8
	callq	_is_badblock
	testq	%rax, %rax
	je	LBB0_9
## %bb.7:
	movq	(%r12), %rax
	movq	(%r15), %rdx
	movq	8(%r15), %rcx
	movq	(%rax,%rcx,8), %rdi
	movq	24(%r15), %rsi
	leaq	-48(%rbp), %rcx
	leaq	-60(%rbp), %r8
	callq	_is_badblock
	testq	%rax, %rax
	jne	LBB0_9
## %bb.8:
	movq	_R1BIO_MadeGood@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	16(%r15), %rsi
	callq	_set_bit
	jmp	LBB0_9
LBB0_1:
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	movl	%r14d, -56(%rbp)                ## 4-byte Spill
	movq	$0, -48(%rbp)
	movq	(%r15), %r12
	movq	24(%r15), %rbx
	leaq	-48(%rbp), %r14
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	4(%r13), %edi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	_bitmap_end_sync
	movq	-48(%rbp), %rax
	addq	%rax, %rbx
	subq	%rax, %r12
	jg	LBB0_2
## %bb.3:
	movq	_WriteErrorSeen@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movq	(%r14), %rax
	movslq	-52(%rbp), %rbx                 ## 4-byte Folded Reload
	movq	(%rax,%rbx,8), %rsi
	callq	_set_bit
	movq	_WantReplacement@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r14), %rax
	movq	(%rax,%rbx,8), %rsi
	callq	_test_and_set_bit
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:
	movq	_MD_RECOVERY_NEEDED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r13, %rsi
	callq	_set_bit
LBB0_5:
	movq	_R1BIO_WriteError@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	16(%r15), %rsi
	callq	_set_bit
	movl	-56(%rbp), %r14d                ## 4-byte Reload
LBB0_9:
	leaq	20(%r15), %rdi
	callq	_atomic_dec_and_test
	testq	%rax, %rax
	je	LBB0_14
## %bb.10:
	movl	(%r15), %r12d
	movq	_R1BIO_MadeGood@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	16(%r15), %rbx
	movq	%rbx, %rsi
	callq	_test_bit
	testl	%eax, %eax
	jne	LBB0_12
## %bb.11:
	movq	_R1BIO_WriteError@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_test_bit
	testl	%eax, %eax
	je	LBB0_13
LBB0_12:
	movq	%r15, %rdi
	callq	_reschedule_retry
LBB0_14:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movq	%r15, %rdi
	callq	_put_buf
	movq	%r13, %rdi
	movl	%r12d, %esi
	movl	%r14d, %edx
	callq	_md_done_sync
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_BIO_UPTODATE,4,2               ## @BIO_UPTODATE
	.comm	_WriteErrorSeen,4,2             ## @WriteErrorSeen
	.comm	_WantReplacement,4,2            ## @WantReplacement
	.comm	_MD_RECOVERY_NEEDED,4,2         ## @MD_RECOVERY_NEEDED
	.comm	_R1BIO_WriteError,4,2           ## @R1BIO_WriteError
	.comm	_R1BIO_MadeGood,4,2             ## @R1BIO_MadeGood
	.no_dead_strip	_end_sync_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function end_sync_write
_end_sync_write:                        ; @end_sync_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x22, x0
Lloh0:
	adrp	x8, _BIO_UPTODATE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BIO_UPTODATE@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	add	x1, x22, #8
	bl	_test_bit
	mov	x19, x0
	ldr	x20, [x22]
	ldr	x21, [x20, #32]
	ldr	x24, [x21, #8]
	mov	x0, x20
	mov	x1, x22
	bl	_find_bio_disk
	mov	x22, x0
	cbz	w19, LBB0_4
; %bb.1:
	ldr	x8, [x24]
	ldr	x0, [x8, w22, sxtw #3]
	ldr	x1, [x20, #24]
	ldr	x2, [x20]
	add	x3, sp, #8
	add	x4, sp, #4
	bl	_is_badblock
	cbz	x0, LBB0_10
; %bb.2:
	ldr	x8, [x24]
	ldp	x2, x9, [x20]
	ldr	x0, [x8, x9, lsl #3]
	ldr	x1, [x20, #24]
	add	x3, sp, #8
	add	x4, sp, #4
	bl	_is_badblock
	cbnz	x0, LBB0_10
; %bb.3:
Lloh3:
	adrp	x8, _R1BIO_MadeGood@GOTPAGE
Lloh4:
	ldr	x8, [x8, _R1BIO_MadeGood@GOTPAGEOFF]
	b	LBB0_9
LBB0_4:
	str	xzr, [sp, #8]
	ldr	x23, [x20, #24]
	ldr	x25, [x20]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x21, #4]
	add	x2, sp, #8
	mov	x1, x23
	mov	w3, #1
	bl	_bitmap_end_sync
	ldr	x8, [sp, #8]
	add	x23, x8, x23
	sub	x25, x25, x8
	cmp	x25, #0
	b.gt	LBB0_5
; %bb.6:
Lloh5:
	adrp	x8, _WriteErrorSeen@GOTPAGE
Lloh6:
	ldr	x8, [x8, _WriteErrorSeen@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	ldr	x8, [x24]
	sbfiz	x22, x22, #3, #32
	ldr	x1, [x8, x22]
	bl	_set_bit
Lloh8:
	adrp	x8, _WantReplacement@GOTPAGE
Lloh9:
	ldr	x8, [x8, _WantReplacement@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	ldr	x8, [x24]
	ldr	x1, [x8, x22]
	bl	_test_and_set_bit
	cbnz	w0, LBB0_8
; %bb.7:
Lloh11:
	adrp	x8, _MD_RECOVERY_NEEDED@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MD_RECOVERY_NEEDED@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	mov	x1, x21
	bl	_set_bit
LBB0_8:
Lloh14:
	adrp	x8, _R1BIO_WriteError@GOTPAGE
Lloh15:
	ldr	x8, [x8, _R1BIO_WriteError@GOTPAGEOFF]
LBB0_9:
	ldr	w0, [x8]
	add	x1, x20, #16
	bl	_set_bit
LBB0_10:
	add	x0, x20, #20
	bl	_atomic_dec_and_test
	cbz	x0, LBB0_14
; %bb.11:
	mov	x23, x20
	ldr	w22, [x23], #16
Lloh16:
	adrp	x8, _R1BIO_MadeGood@GOTPAGE
Lloh17:
	ldr	x8, [x8, _R1BIO_MadeGood@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	mov	x1, x23
	bl	_test_bit
	cbnz	w0, LBB0_13
; %bb.12:
Lloh19:
	adrp	x8, _R1BIO_WriteError@GOTPAGE
Lloh20:
	ldr	x8, [x8, _R1BIO_WriteError@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	mov	x1, x23
	bl	_test_bit
	cbz	w0, LBB0_15
LBB0_13:
	mov	x0, x20
	bl	_reschedule_retry
LBB0_14:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_15:
	mov	x0, x20
	bl	_put_buf
	mov	x0, x21
	mov	x1, x22
	mov	x2, x19
	bl	_md_done_sync
	b	LBB0_14
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_BIO_UPTODATE,4,2               ; @BIO_UPTODATE
	.comm	_WriteErrorSeen,4,2             ; @WriteErrorSeen
	.comm	_WantReplacement,4,2            ; @WantReplacement
	.comm	_MD_RECOVERY_NEEDED,4,2         ; @MD_RECOVERY_NEEDED
	.comm	_R1BIO_WriteError,4,2           ; @R1BIO_WriteError
	.comm	_R1BIO_MadeGood,4,2             ; @R1BIO_MadeGood
	.no_dead_strip	_end_sync_write
.subsections_via_symbols
