	.file	"extr_vdev.c_vdev_clear.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	vdev_clear
	.type	vdev_clear, @function
vdev_clear:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, rsi
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	mov	edx, DWORD PTR RW_WRITER[rip]
	mov	rsi, QWORD PTR SCL_STATE_ALL[rip]
	mov	r13, QWORD PTR 8[rdi]
	call	spa_config_held@PLT
	xor	edi, edi
	cmp	QWORD PTR SCL_STATE_ALL[rip], rax
	sete	dil
	call	ASSERT@PLT
	test	rbx, rbx
	cmove	rbx, r13
	mov	eax, DWORD PTR [rbx]
	mov	QWORD PTR 96[rbx], 0
	mov	QWORD PTR 88[rbx], 0
	mov	QWORD PTR 80[rbx], 0
	mov	QWORD PTR 72[rbx], 0
	test	eax, eax
	jle	.L3
	xor	ebp, ebp
.L4:
	mov	rax, QWORD PTR 120[rbx]
	mov	rdi, r12
	mov	rsi, QWORD PTR [rax+rbp*8]
	add	rbp, 1
	call	vdev_clear
	cmp	DWORD PTR [rbx], ebp
	jg	.L4
.L3:
	mov	rdi, rbx
	call	vdev_is_concrete@PLT
	test	eax, eax
	je	.L1
	cmp	QWORD PTR 8[rbx], 0
	je	.L7
.L10:
	mov	rax, QWORD PTR B_TRUE[rip]
	mov	QWORD PTR 16[rbx], 0
	mov	QWORD PTR 8[rbx], 0
	mov	QWORD PTR 56[rbx], rax
	mov	rax, QWORD PTR B_FALSE[rip]
	mov	QWORD PTR 64[rbx], 0
	mov	QWORD PTR 112[rbx], rax
	mov	QWORD PTR 104[rbx], rax
	cmp	rbx, r13
	je	.L40
	mov	rdi, QWORD PTR 48[rbx]
	call	vdev_reopen@PLT
	mov	rax, QWORD PTR B_FALSE[rip]
	mov	rdi, QWORD PTR 48[rbx]
	mov	QWORD PTR 56[rbx], rax
	call	vdev_writeable@PLT
	test	rax, rax
	jne	.L41
.L12:
	cmp	QWORD PTR 40[rbx], 0
	je	.L42
.L14:
	mov	ecx, DWORD PTR ESC_ZFS_VDEV_CLEAR[rip]
	xor	edx, edx
	mov	rsi, rbx
	mov	rdi, r12
	call	spa_event_notify@PLT
.L11:
	mov	rdi, rbx
	call	vdev_is_dead@PLT
	test	eax, eax
	jne	.L1
	mov	rax, QWORD PTR 32[rbx]
	test	rax, rax
	je	.L1
	lea	rdx, vdev_spare_ops[rip]
	cmp	QWORD PTR 8[rax], rdx
	je	.L43
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	cmp	QWORD PTR 16[rbx], 0
	jne	.L10
	mov	rdi, rbx
	call	vdev_readable@PLT
	test	eax, eax
	je	.L10
	mov	rdi, rbx
	call	vdev_writeable@PLT
	test	rax, rax
	je	.L10
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L40:
	mov	rdi, rbx
	call	vdev_reopen@PLT
	mov	rax, QWORD PTR B_FALSE[rip]
	cmp	QWORD PTR 40[rbx], 0
	mov	QWORD PTR 56[rbx], rax
	jne	.L14
.L42:
	mov	rdi, rbx
	call	vdev_is_dead@PLT
	test	eax, eax
	jne	.L14
	mov	edi, DWORD PTR [r12]
	call	dsl_scan_resilvering@PLT
	test	rax, rax
	je	.L16
	mov	esi, DWORD PTR SPA_FEATURE_RESILVER_DEFER[rip]
	mov	rdi, r12
	call	spa_feature_is_enabled@PLT
	test	rax, rax
	jne	.L44
.L16:
	mov	esi, DWORD PTR SPA_ASYNC_RESILVER[rip]
	mov	rdi, r12
	call	spa_async_request@PLT
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L43:
	mov	rax, QWORD PTR [rax]
	cmp	QWORD PTR [rax], rbx
	jne	.L1
	mov	rax, QWORD PTR B_TRUE[rip]
	mov	QWORD PTR 24[rbx], rax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L41:
	mov	rdi, QWORD PTR 48[rbx]
	call	vdev_state_dirty@PLT
	jmp	.L12
.L44:
	mov	rsi, rbx
	mov	rdi, r12
	call	vdev_set_deferred_resilver@PLT
	jmp	.L14
	.cfi_endproc
.LFE0:
	.size	vdev_clear, .-vdev_clear
	.comm	vdev_spare_ops,4,4
	.comm	SPA_FEATURE_RESILVER_DEFER,4,4
	.comm	SPA_ASYNC_RESILVER,4,4
	.comm	SCL_STATE_ALL,8,8
	.comm	RW_WRITER,4,4
	.comm	ESC_ZFS_VDEV_CLEAR,4,4
	.comm	B_TRUE,8,8
	.comm	B_FALSE,8,8
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_vdev.c_vdev_clear.c"
	.text
	.align	2
	.global	vdev_clear
	.syntax unified
	.arm
	.fpu softvfp
	.type	vdev_clear, %function
vdev_clear:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r3, .L44
	ldr	r5, .L44+4
	mov	r4, r1
	ldr	r2, [r3]
	ldr	r1, [r5]
	ldr	r7, [r0, #4]
	mov	r6, r0
	bl	spa_config_held
	ldr	r3, [r5]
	cmp	r4, #0
	sub	r0, r3, r0
	clz	r0, r0
	moveq	r4, r7
	mov	r5, #0
	lsr	r0, r0, #5
	bl	ASSERT
	ldr	r3, [r4]
	str	r5, [r4, #60]
	cmp	r3, r5
	str	r5, [r4, #56]
	str	r5, [r4, #52]
	str	r5, [r4, #48]
	ble	.L3
.L4:
	ldr	r3, [r4, #72]
	mov	r0, r6
	ldr	r1, [r3, r5, lsl #2]
	bl	vdev_clear
	ldr	r3, [r4]
	add	r5, r5, #1
	cmp	r3, r5
	bgt	.L4
.L3:
	mov	r0, r4
	bl	vdev_is_concrete
	cmp	r0, #0
	popeq	{r4, r5, r6, r7, r8, pc}
	add	r3, r4, #8
	ldmia	r3, {r2-r3}
	orrs	r3, r2, r3
	beq	.L7
.L10:
	mov	r0, #0
	mov	r1, #0
	mov	r2, #0
	ldr	r3, .L44+8
	ldr	r5, .L44+12
	ldr	r3, [r3]
	cmp	r4, r7
	str	r3, [r4, #40]
	ldr	r3, [r5]
	str	r0, [r4, #16]
	str	r1, [r4, #20]
	str	r0, [r4, #8]
	str	r1, [r4, #12]
	str	r3, [r4, #68]
	str	r3, [r4, #64]
	str	r2, [r4, #44]
	beq	.L40
	ldr	r0, [r4, #36]
	bl	vdev_reopen
	ldr	r3, [r5]
	ldr	r0, [r4, #36]
	str	r3, [r4, #40]
	bl	vdev_writeable
	cmp	r0, #0
	bne	.L41
.L12:
	ldr	r3, [r4, #32]
	cmp	r3, #0
	beq	.L42
.L14:
	ldr	r3, .L44+16
	mov	r0, r6
	mov	r2, #0
	mov	r1, r4
	ldr	r3, [r3]
	bl	spa_event_notify
.L11:
	mov	r0, r4
	bl	vdev_is_dead
	cmp	r0, #0
	popne	{r4, r5, r6, r7, r8, pc}
	ldr	r3, [r4, #28]
	cmp	r3, #0
	popeq	{r4, r5, r6, r7, r8, pc}
	ldr	r2, .L44+20
	ldr	r1, [r3, #4]
	cmp	r1, r2
	popne	{r4, r5, r6, r7, r8, pc}
	ldr	r3, [r3]
	ldr	r3, [r3]
	cmp	r3, r4
	ldreq	r3, .L44+8
	ldreq	r3, [r3]
	streq	r3, [r4, #24]
	pop	{r4, r5, r6, r7, r8, pc}
.L7:
	add	r3, r4, #16
	ldmia	r3, {r2-r3}
	orrs	r3, r2, r3
	bne	.L10
	mov	r0, r4
	bl	vdev_readable
	cmp	r0, #0
	beq	.L10
	mov	r0, r4
	bl	vdev_writeable
	cmp	r0, #0
	beq	.L10
	b	.L11
.L40:
	mov	r0, r4
	bl	vdev_reopen
	ldr	r3, [r5]
	str	r3, [r4, #40]
	ldr	r3, [r4, #32]
	cmp	r3, #0
	bne	.L14
.L42:
	mov	r0, r4
	bl	vdev_is_dead
	cmp	r0, #0
	bne	.L14
	ldr	r0, [r6]
	bl	dsl_scan_resilvering
	cmp	r0, #0
	beq	.L16
	ldr	r3, .L44+24
	mov	r0, r6
	ldr	r1, [r3]
	bl	spa_feature_is_enabled
	cmp	r0, #0
	bne	.L43
.L16:
	ldr	r3, .L44+28
	mov	r0, r6
	ldr	r1, [r3]
	bl	spa_async_request
	b	.L14
.L41:
	ldr	r0, [r4, #36]
	bl	vdev_state_dirty
	b	.L12
.L43:
	mov	r1, r4
	mov	r0, r6
	bl	vdev_set_deferred_resilver
	b	.L14
.L45:
	.align	2
.L44:
	.word	RW_WRITER
	.word	SCL_STATE_ALL
	.word	B_TRUE
	.word	B_FALSE
	.word	ESC_ZFS_VDEV_CLEAR
	.word	vdev_spare_ops
	.word	SPA_FEATURE_RESILVER_DEFER
	.word	SPA_ASYNC_RESILVER
	.size	vdev_clear, .-vdev_clear
	.comm	vdev_spare_ops,4,4
	.comm	SPA_FEATURE_RESILVER_DEFER,4,4
	.comm	SPA_ASYNC_RESILVER,4,4
	.comm	SCL_STATE_ALL,4,4
	.comm	RW_WRITER,4,4
	.comm	ESC_ZFS_VDEV_CLEAR,4,4
	.comm	B_TRUE,4,4
	.comm	B_FALSE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
