	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function handle_write_finished
_handle_write_finished:                 ## @handle_write_finished
	.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	%rsi, %r14
	cmpl	$0, (%rdi)
	jle	LBB0_11
## %bb.1:
	movq	%rdi, %r15
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	40(%r15), %rax
	movq	(%rax,%rbx,8), %r12
	movl	4(%r14), %esi
	movl	24(%r14), %edx
	movq	%r12, %rdi
	xorl	%ecx, %ecx
	callq	_rdev_clear_badblocks
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%r15), %rsi
	movq	%r12, %rdi
	callq	_rdev_dec_pending
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%rbx
	movslq	(%r15), %rax
	addq	%rax, %rax
	cmpq	%rax, %rbx
	jge	LBB0_10
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r14), %rax
	movq	(%rax,%rbx,8), %rax
	movq	_IO_MADE_GOOD@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	testq	%rax, %rax
	je	LBB0_9
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_narrow_write_error
	testl	%eax, %eax
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%r15), %rdi
	movq	40(%r15), %rax
	movq	(%rax,%rbx,8), %rsi
	callq	_md_error
	movq	_R1BIO_Degraded@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_set_bit
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	40(%r15), %rax
	movq	(%rax,%rbx,8), %r12
	movl	$1, %r13d
	jmp	LBB0_8
LBB0_10:
	testl	%r13d, %r13d
	je	LBB0_11
## %bb.14:
	leaq	20(%r15), %rbx
	movq	%rbx, %rdi
	callq	_spin_lock_irq
	leaq	8(%r14), %rdi
	leaq	32(%r15), %rsi
	callq	_list_add
	movl	4(%r14), %edi
	callq	_sector_to_idx
	movslq	%eax, %rdi
	shlq	$2, %rdi
	addq	24(%r15), %rdi
	callq	_atomic_inc
	movq	%rbx, %rdi
	callq	_spin_unlock_irq
	leaq	16(%r15), %rdi
	callq	_wake_up
	movq	8(%r15), %rax
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_md_wakeup_thread               ## TAILCALL
LBB0_11:
	movq	_R1BIO_WriteError@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	movq	%r14, %rdi
	callq	_close_write
LBB0_13:
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_raid_end_bio_io                ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_IO_MADE_GOOD,8,3               ## @IO_MADE_GOOD
	.comm	_R1BIO_Degraded,4,2             ## @R1BIO_Degraded
	.comm	_R1BIO_WriteError,4,2           ## @R1BIO_WriteError
	.no_dead_strip	_handle_write_finished
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function handle_write_finished
_handle_write_finished:                 ; @handle_write_finished
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x20, x1
	ldr	w8, [x0]
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.1:
	mov	x19, x0
	mov	x21, #0
	mov	w25, #0
Lloh0:
	adrp	x23, _IO_MADE_GOOD@GOTPAGE
Lloh1:
	ldr	x23, [x23, _IO_MADE_GOOD@GOTPAGEOFF]
Lloh2:
	adrp	x24, _R1BIO_Degraded@GOTPAGE
Lloh3:
	ldr	x24, [x24, _R1BIO_Degraded@GOTPAGEOFF]
	b	LBB0_5
LBB0_2:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x19, #40]
	ldr	x22, [x8, x21, lsl #3]
	ldr	w1, [x20, #4]
	ldr	w2, [x20, #24]
	mov	x0, x22
	mov	w3, #0
	bl	_rdev_clear_badblocks
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x1, [x19, #8]
	mov	x0, x22
	bl	_rdev_dec_pending
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x21, x21, #1
	ldrsw	x8, [x19]
	cmp	x21, x8, lsl #1
	b.ge	LBB0_10
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #16]
	ldr	x8, [x8, x21, lsl #3]
	ldr	x9, [x23]
	cmp	x8, x9
	b.eq	LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	cbz	x8, LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x20
	mov	x1, x21
	bl	_narrow_write_error
	cbnz	w0, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x0, [x19, #8]
	ldr	x8, [x19, #40]
	ldr	x1, [x8, x21, lsl #3]
	bl	_md_error
	ldr	w0, [x24]
	mov	x1, x20
	bl	_set_bit
LBB0_9:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x19, #40]
	ldr	x22, [x8, x21, lsl #3]
	mov	w25, #1
	b	LBB0_3
LBB0_10:
	cbz	w25, LBB0_12
; %bb.11:
	add	x21, x19, #20
	mov	x0, x21
	bl	_spin_lock_irq
	add	x0, x20, #8
	add	x1, x19, #32
	bl	_list_add
	ldr	w0, [x20, #4]
	bl	_sector_to_idx
	ldr	x8, [x19, #24]
	add	x0, x8, w0, sxtw #2
	bl	_atomic_inc
	mov	x0, x21
	bl	_spin_unlock_irq
	add	x0, x19, #16
	bl	_wake_up
	ldr	x8, [x19, #8]
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_md_wakeup_thread
LBB0_12:
Lloh4:
	adrp	x8, _R1BIO_WriteError@GOTPAGE
Lloh5:
	ldr	x8, [x8, _R1BIO_WriteError@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_test_bit
	cbz	x0, LBB0_14
; %bb.13:
	mov	x0, x20
	bl	_close_write
LBB0_14:
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_raid_end_bio_io
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_IO_MADE_GOOD,8,3               ; @IO_MADE_GOOD
	.comm	_R1BIO_Degraded,4,2             ; @R1BIO_Degraded
	.comm	_R1BIO_WriteError,4,2           ; @R1BIO_WriteError
	.no_dead_strip	_handle_write_finished
.subsections_via_symbols
