	.file	"extr_spa.c_spa_vdev_add.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	spa_vdev_add
	.type	spa_vdev_add, @function
spa_vdev_add:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rsi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 56
	.cfi_def_cfa_offset 112
	mov	rbx, QWORD PTR 48[rdi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	call	spa_writeable@PLT
	mov	edi, eax
	call	ASSERT@PLT
	mov	rdi, rbp
	call	spa_vdev_enter@PLT
	xor	r8d, r8d
	xor	ecx, ecx
	mov	rsi, rsp
	mov	r9d, DWORD PTR VDEV_ALLOC_ADD[rip]
	mov	rdx, r13
	mov	rdi, rbp
	mov	r12, rax
	call	spa_config_parse@PLT
	test	eax, eax
	jne	.L52
	mov	rax, QWORD PTR [rsp]
	mov	esi, DWORD PTR ZPOOL_CONFIG_SPARES[rip]
	lea	rcx, 24[rsp]
	mov	rdi, r13
	lea	rdx, 8[rsp]
	mov	QWORD PTR 40[rbp], rax
	call	nvlist_lookup_nvlist_array@PLT
	test	rax, rax
	je	.L4
	mov	QWORD PTR 24[rsp], 0
.L4:
	mov	esi, DWORD PTR ZPOOL_CONFIG_L2CACHE[rip]
	lea	rcx, 32[rsp]
	lea	rdx, 16[rsp]
	mov	rdi, r13
	call	nvlist_lookup_nvlist_array@PLT
	test	rax, rax
	je	.L5
	mov	QWORD PTR 32[rsp], 0
.L5:
	mov	rdi, QWORD PTR [rsp]
	cmp	QWORD PTR [rdi], 0
	jne	.L6
	mov	rax, QWORD PTR 24[rsp]
	or	rax, QWORD PTR 32[rsp]
	je	.L49
.L7:
	mov	ecx, DWORD PTR VDEV_ALLOC_ADD[rip]
	mov	rsi, r13
	mov	rdx, r12
	mov	rdi, rbp
	call	spa_validate_aux@PLT
	mov	r13d, eax
	test	eax, eax
	jne	.L53
	mov	rdi, QWORD PTR [rsp]
	mov	r8, QWORD PTR 24[rbp]
	mov	r9, QWORD PTR [rdi]
	test	r8, r8
	je	.L54
.L9:
	test	r9, r9
	jle	.L12
	mov	rax, QWORD PTR 24[rdi]
	xor	ecx, ecx
	lea	r10, vdev_raidz_ops[rip]
	lea	r11, vdev_mirror_ops[rip]
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L16:
	add	rcx, 1
	cmp	r9, rcx
	je	.L20
.L19:
	mov	rdx, QWORD PTR [rax+rcx*8]
	test	r8, r8
	je	.L14
	mov	rsi, QWORD PTR 0[rbp]
	cmp	QWORD PTR 8[rdx], rsi
	jne	.L49
.L14:
	mov	rsi, QWORD PTR 32[rdx]
	cmp	rsi, r10
	je	.L49
	cmp	rsi, r11
	jne	.L16
	mov	r14, QWORD PTR [rdx]
	test	r14, r14
	je	.L16
	mov	r15, QWORD PTR 24[rdx]
	xor	edx, edx
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L17:
	add	rdx, 1
	cmp	rdx, r14
	je	.L16
.L18:
	mov	rsi, QWORD PTR [r15+rdx*8]
	mov	rsi, QWORD PTR 32[rsi]
	mov	esi, DWORD PTR [rsi]
	test	esi, esi
	jne	.L17
.L49:
	mov	ecx, DWORD PTR EINVAL[rip]
	mov	rsi, rdi
	mov	rdx, r12
	mov	rdi, rbp
	call	spa_vdev_exit@PLT
	mov	r13d, eax
.L1:
	mov	rax, QWORD PTR 40[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L55
	add	rsp, 56
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r13d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	mov	edx, DWORD PTR B_FALSE[rip]
	mov	rsi, r12
	call	vdev_create@PLT
	mov	ecx, eax
	test	eax, eax
	je	.L7
.L50:
	mov	rsi, QWORD PTR [rsp]
	mov	rdx, r12
	mov	rdi, rbp
	call	spa_vdev_exit@PLT
	mov	r13d, eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L52:
	mov	ecx, eax
	mov	rdx, r12
	xor	esi, esi
	mov	rdi, rbp
	call	spa_vdev_exit@PLT
	mov	r13d, eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L54:
	cmp	DWORD PTR 32[rbp], -1
	jne	.L9
	test	r9, r9
	jle	.L12
	mov	rax, QWORD PTR 24[rdi]
.L20:
	xor	r15d, r15d
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L56:
	mov	rax, QWORD PTR 24[rdi]
.L21:
	mov	r14, QWORD PTR [rax+r15*8]
	add	r15, 1
	mov	rsi, r14
	call	vdev_remove_child@PLT
	mov	rax, QWORD PTR [rbx]
	mov	rsi, r14
	mov	rdi, rbx
	mov	DWORD PTR 16[r14], eax
	call	vdev_add_child@PLT
	mov	rdi, r14
	call	vdev_config_dirty@PLT
	mov	rdi, QWORD PTR [rsp]
	cmp	QWORD PTR [rdi], r15
	jg	.L56
.L12:
	mov	rdx, QWORD PTR 24[rsp]
	test	rdx, rdx
	jne	.L57
.L22:
	mov	rdx, QWORD PTR 32[rsp]
	test	rdx, rdx
	jne	.L58
.L23:
	mov	rsi, QWORD PTR [rsp]
	xor	ecx, ecx
	mov	rdx, r12
	mov	rdi, rbp
	call	spa_vdev_exit@PLT
	lea	rdi, spa_namespace_lock[rip]
	call	mutex_enter@PLT
	mov	esi, DWORD PTR SPA_CONFIG_UPDATE_POOL[rip]
	mov	rdi, rbp
	call	spa_config_update@PLT
	mov	ecx, DWORD PTR ESC_ZFS_VDEV_ADD[rip]
	mov	rdi, rbp
	xor	edx, edx
	xor	esi, esi
	call	spa_event_notify@PLT
	lea	rdi, spa_namespace_lock[rip]
	call	mutex_exit@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L53:
	mov	ecx, eax
	jmp	.L50
	.p2align 4,,10
	.p2align 3
.L58:
	mov	ecx, DWORD PTR ZPOOL_CONFIG_L2CACHE[rip]
	mov	rsi, QWORD PTR 16[rsp]
	lea	rdi, 8[rbp]
	call	spa_set_aux_vdevs@PLT
	mov	rdi, rbp
	call	spa_load_l2cache@PLT
	mov	rax, QWORD PTR B_TRUE[rip]
	mov	QWORD PTR 8[rbp], rax
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L57:
	mov	ecx, DWORD PTR ZPOOL_CONFIG_SPARES[rip]
	mov	rsi, QWORD PTR 8[rsp]
	lea	rdi, 16[rbp]
	call	spa_set_aux_vdevs@PLT
	mov	rdi, rbp
	call	spa_load_spares@PLT
	mov	rax, QWORD PTR B_TRUE[rip]
	mov	QWORD PTR 16[rbp], rax
	jmp	.L22
.L55:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	spa_vdev_add, .-spa_vdev_add
	.comm	vdev_raidz_ops,4,4
	.comm	vdev_mirror_ops,4,4
	.comm	spa_namespace_lock,4,4
	.comm	ZPOOL_CONFIG_SPARES,4,4
	.comm	ZPOOL_CONFIG_L2CACHE,4,4
	.comm	VDEV_ALLOC_ADD,4,4
	.comm	SPA_CONFIG_UPDATE_POOL,4,4
	.comm	ESC_ZFS_VDEV_ADD,4,4
	.comm	EINVAL,4,4
	.comm	B_TRUE,8,8
	.comm	B_FALSE,4,4
	.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_spa.c_spa_vdev_add.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	spa_vdev_add
	.syntax unified
	.arm
	.fpu softvfp
	.type	spa_vdev_add, %function
spa_vdev_add:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, r0
	ldr	r3, .L60
	sub	sp, sp, #44
	mov	r5, r1
	ldr	r3, [r3]
	str	r3, [sp, #36]
	mov	r3,#0
	ldr	r7, [r0, #24]
	bl	spa_writeable
	bl	ASSERT
	mov	r0, r4
	bl	spa_vdev_enter
	mov	r10, #0
	ldr	r8, .L60+4
	mov	r6, r0
	ldr	r3, [r8]
	mov	r2, r5
	str	r3, [sp, #4]
	mov	r0, r4
	mov	r3, r10
	str	r10, [sp]
	add	r1, sp, #16
	bl	spa_config_parse
	subs	r9, r0, #0
	bne	.L53
	ldr	r3, [sp, #16]
	add	r2, sp, #20
	str	r3, [r4, #20]
	ldr	r3, .L60+8
	mov	r0, r5
	ldr	r1, [r3]
	add	r3, sp, #28
	bl	nvlist_lookup_nvlist_array
	ldr	r2, .L60+12
	cmp	r0, #0
	add	r3, sp, #32
	ldr	r1, [r2]
	mov	r0, r5
	add	r2, sp, #24
	strne	r9, [sp, #28]
	bl	nvlist_lookup_nvlist_array
	cmp	r0, #0
	movne	r3, #0
	ldr	r0, [sp, #16]
	strne	r3, [sp, #32]
	ldr	r3, [r0]
	cmp	r3, #0
	bne	.L6
	ldr	r2, [sp, #28]
	ldr	r3, [sp, #32]
	orrs	r3, r2, r3
	beq	.L50
.L7:
	mov	r1, r5
	mov	r2, r6
	mov	r0, r4
	ldr	r3, [r8]
	bl	spa_validate_aux
	subs	r5, r0, #0
	bne	.L54
	ldr	r9, [r4, #12]
	ldr	r0, [sp, #16]
	cmp	r9, #0
	ldr	r10, [r0]
	beq	.L55
.L9:
	cmp	r10, #0
	ble	.L12
	ldr	r3, [r0, #12]
	mov	r2, #0
	ldr	fp, .L60+16
	str	r3, [sp, #12]
	sub	r8, r3, #4
	b	.L19
.L16:
	add	r2, r2, #1
	cmp	r2, r10
	beq	.L20
.L19:
	cmp	r9, #0
	ldr	r1, [r8, #4]!
	beq	.L14
	ldr	ip, [r1, #4]
	ldr	r3, [r4]
	cmp	ip, r3
	bne	.L50
.L14:
	ldr	r3, [r1, #16]
	cmp	r3, fp
	beq	.L50
	ldr	ip, .L60+20
	cmp	r3, ip
	bne	.L16
	ldr	ip, [r1]
	cmp	ip, #0
	beq	.L16
	ldr	r1, [r1, #12]
	mov	r3, #0
	sub	r1, r1, #4
	b	.L18
.L17:
	add	r3, r3, #1
	cmp	r3, ip
	beq	.L16
.L18:
	ldr	lr, [r1, #4]!
	ldr	lr, [lr, #16]
	ldr	lr, [lr]
	cmp	lr, #0
	bne	.L17
.L50:
	ldr	r3, .L60+24
	mov	r1, r0
	mov	r2, r6
	mov	r0, r4
	ldr	r3, [r3]
	bl	spa_vdev_exit
	mov	r5, r0
.L1:
	ldr	r3, .L60
	ldr	r2, [r3]
	ldr	r3, [sp, #36]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L56
	mov	r0, r5
	add	sp, sp, #44
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L6:
	ldr	r3, .L60+28
	mov	r1, r6
	ldr	r2, [r3]
	bl	vdev_create
	subs	r3, r0, #0
	beq	.L7
.L51:
	mov	r2, r6
	mov	r0, r4
	ldr	r1, [sp, #16]
	bl	spa_vdev_exit
	mov	r5, r0
	b	.L1
.L53:
	mov	r3, r9
	mov	r2, r6
	mov	r1, r10
	mov	r0, r4
	bl	spa_vdev_exit
	mov	r5, r0
	b	.L1
.L55:
	ldr	r3, [r4, #16]
	cmn	r3, #1
	bne	.L9
	cmp	r10, #0
	ldrgt	r3, [r0, #12]
	strgt	r3, [sp, #12]
	ble	.L12
.L20:
	mov	r9, #0
	ldr	r3, [sp, #12]
	b	.L21
.L57:
	ldr	r3, [r0, #12]
.L21:
	ldr	r8, [r3, r9, lsl #2]
	add	r9, r9, #1
	mov	r1, r8
	bl	vdev_remove_child
	ldr	r3, [r7]
	mov	r1, r8
	str	r3, [r8, #8]
	mov	r0, r7
	bl	vdev_add_child
	mov	r0, r8
	bl	vdev_config_dirty
	ldr	r0, [sp, #16]
	ldr	r3, [r0]
	cmp	r3, r9
	bgt	.L57
.L12:
	ldr	r2, [sp, #28]
	cmp	r2, #0
	bne	.L58
.L22:
	ldr	r2, [sp, #32]
	cmp	r2, #0
	bne	.L59
.L23:
	mov	r2, r6
	ldr	r1, [sp, #16]
	mov	r3, #0
	mov	r0, r4
	bl	spa_vdev_exit
	ldr	r0, .L60+32
	bl	mutex_enter
	ldr	r3, .L60+36
	mov	r0, r4
	ldr	r1, [r3]
	bl	spa_config_update
	mov	r2, #0
	ldr	r3, .L60+40
	mov	r0, r4
	mov	r1, r2
	ldr	r3, [r3]
	bl	spa_event_notify
	ldr	r0, .L60+32
	bl	mutex_exit
	b	.L1
.L54:
	mov	r3, r5
	b	.L51
.L59:
	ldr	r3, .L60+12
	ldr	r1, [sp, #24]
	ldr	r3, [r3]
	add	r0, r4, #4
	bl	spa_set_aux_vdevs
	mov	r0, r4
	bl	spa_load_l2cache
	ldr	r3, .L60+44
	ldr	r3, [r3]
	str	r3, [r4, #4]
	b	.L23
.L58:
	ldr	r3, .L60+8
	ldr	r1, [sp, #20]
	ldr	r3, [r3]
	add	r0, r4, #8
	bl	spa_set_aux_vdevs
	mov	r0, r4
	bl	spa_load_spares
	ldr	r3, .L60+44
	ldr	r3, [r3]
	str	r3, [r4, #8]
	b	.L22
.L56:
	bl	__stack_chk_fail
.L61:
	.align	2
.L60:
	.word	.LC0
	.word	VDEV_ALLOC_ADD
	.word	ZPOOL_CONFIG_SPARES
	.word	ZPOOL_CONFIG_L2CACHE
	.word	vdev_raidz_ops
	.word	vdev_mirror_ops
	.word	EINVAL
	.word	B_FALSE
	.word	spa_namespace_lock
	.word	SPA_CONFIG_UPDATE_POOL
	.word	ESC_ZFS_VDEV_ADD
	.word	B_TRUE
	.size	spa_vdev_add, .-spa_vdev_add
	.comm	vdev_raidz_ops,4,4
	.comm	vdev_mirror_ops,4,4
	.comm	spa_namespace_lock,4,4
	.comm	ZPOOL_CONFIG_SPARES,4,4
	.comm	ZPOOL_CONFIG_L2CACHE,4,4
	.comm	VDEV_ALLOC_ADD,4,4
	.comm	SPA_CONFIG_UPDATE_POOL,4,4
	.comm	ESC_ZFS_VDEV_ADD,4,4
	.comm	EINVAL,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
