	.file	"extr_spa.c_spa_sync_upgrades.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	spa_sync_upgrades, @function
spa_sync_upgrades:
.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
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rsi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, rdi
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	call	spa_sync_pass@PLT
	cmp	eax, 1
	je	.L20
	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
.L20:
	.cfi_restore_state
	mov	r12, QWORD PTR 32[rbx]
	mov	edx, DWORD PTR FTAG[rip]
	mov	esi, DWORD PTR RW_WRITER[rip]
	mov	rdi, r12
	call	rrw_enter@PLT
	mov	rax, QWORD PTR 24[rbx]
	mov	rcx, QWORD PTR SPA_VERSION_ORIGIN[rip]
	mov	rdx, QWORD PTR 16[rbx]
	cmp	rax, rcx
	jge	.L4
	cmp	rcx, rdx
	jg	.L4
	mov	rsi, rbp
	mov	rdi, r12
	call	dsl_pool_create_origin@PLT
	add	DWORD PTR [rbx], 3
	mov	rax, QWORD PTR 24[rbx]
	mov	rdx, QWORD PTR 16[rbx]
	.p2align 4,,10
	.p2align 3
.L4:
	mov	rcx, QWORD PTR SPA_VERSION_NEXT_CLONES[rip]
	cmp	rcx, rax
	jle	.L5
	cmp	rcx, rdx
	jg	.L5
	mov	rsi, rbp
	mov	rdi, r12
	call	dsl_pool_upgrade_clones@PLT
	mov	rax, QWORD PTR 24[rbx]
	mov	rdx, QWORD PTR 16[rbx]
	.p2align 4,,10
	.p2align 3
.L5:
	mov	rcx, QWORD PTR SPA_VERSION_DIR_CLONES[rip]
	cmp	rcx, rax
	jle	.L6
	cmp	rcx, rdx
	jg	.L6
	mov	rsi, rbp
	mov	rdi, r12
	call	dsl_pool_upgrade_dir_clones@PLT
	add	DWORD PTR [rbx], 3
	mov	rax, QWORD PTR 24[rbx]
	mov	rdx, QWORD PTR 16[rbx]
	.p2align 4,,10
	.p2align 3
.L6:
	mov	rcx, QWORD PTR SPA_VERSION_FEATURES[rip]
	cmp	rcx, rax
	jle	.L7
	cmp	rcx, rdx
	jg	.L9
	mov	rsi, rbp
	mov	rdi, rbx
	call	spa_feature_create_zap_objects@PLT
	mov	rdx, QWORD PTR 16[rbx]
	mov	rcx, QWORD PTR SPA_VERSION_FEATURES[rip]
.L7:
	cmp	rdx, rcx
	jge	.L21
.L9:
	mov	edi, DWORD PTR 8[rbx]
	mov	edx, DWORD PTR DMU_POOL_CHECKSUM_SALT[rip]
	mov	esi, DWORD PTR DMU_POOL_DIRECTORY_OBJECT[rip]
	call	zap_contains@PLT
	cmp	rax, QWORD PTR ENOENT[rip]
	je	.L22
.L11:
	mov	esi, DWORD PTR FTAG[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	rdi, r12
	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
	jmp	rrw_exit@PLT
	.p2align 4,,10
	.p2align 3
.L21:
	.cfi_restore_state
	mov	esi, DWORD PTR SPA_FEATURE_LZ4_COMPRESS[rip]
	mov	rdi, rbx
	call	spa_feature_is_enabled@PLT
	mov	esi, DWORD PTR SPA_FEATURE_LZ4_COMPRESS[rip]
	mov	rdi, rbx
	mov	r13, rax
	call	spa_feature_is_active@PLT
	test	r13, r13
	je	.L9
	test	rax, rax
	jne	.L9
	mov	esi, DWORD PTR SPA_FEATURE_LZ4_COMPRESS[rip]
	mov	rdx, rbp
	mov	rdi, rbx
	call	spa_feature_incr@PLT
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L22:
	sub	rsp, 8
	.cfi_def_cfa_offset 56
	mov	edi, DWORD PTR 8[rbx]
	mov	r9d, DWORD PTR 4[rbx]
	mov	ecx, 1
	push	rbp
	.cfi_def_cfa_offset 64
	mov	edx, DWORD PTR DMU_POOL_CHECKSUM_SALT[rip]
	mov	r8d, 4
	mov	esi, DWORD PTR DMU_POOL_DIRECTORY_OBJECT[rip]
	call	zap_add@PLT
	mov	edi, eax
	call	VERIFY0@PLT
	pop	rax
	.cfi_def_cfa_offset 56
	pop	rdx
	.cfi_def_cfa_offset 48
	jmp	.L11
	.cfi_endproc
.LFE0:
	.size	spa_sync_upgrades, .-spa_sync_upgrades
	.comm	SPA_VERSION_ORIGIN,8,8
	.comm	SPA_VERSION_NEXT_CLONES,8,8
	.comm	SPA_VERSION_FEATURES,8,8
	.comm	SPA_VERSION_DIR_CLONES,8,8
	.comm	SPA_FEATURE_LZ4_COMPRESS,4,4
	.comm	RW_WRITER,4,4
	.comm	FTAG,4,4
	.comm	ENOENT,8,8
	.comm	DMU_POOL_DIRECTORY_OBJECT,4,4
	.comm	DMU_POOL_CHECKSUM_SALT,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_sync_upgrades.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	spa_sync_upgrades, %function
spa_sync_upgrades:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	sub	sp, sp, #20
	mov	r5, r1
	mov	r4, r0
	bl	spa_sync_pass
	cmp	r0, #1
	beq	.L17
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L17:
	ldr	r3, .L20
	ldr	r6, [r4, #20]
	ldr	r7, .L20+4
	ldr	r1, [r3]
	ldr	r2, [r7]
	mov	r0, r6
	bl	rrw_enter
	ldr	r2, .L20+8
	ldr	r3, [r4, #16]
	ldr	r1, [r2]
	ldr	r2, [r4, #12]
	cmp	r3, r1
	bge	.L4
	cmp	r1, r2
	bgt	.L4
	mov	r1, r5
	mov	r0, r6
	bl	dsl_pool_create_origin
	ldr	r1, [r4]
	ldr	r3, [r4, #16]
	add	r1, r1, #3
	ldr	r2, [r4, #12]
	str	r1, [r4]
.L4:
	ldr	r1, .L20+12
	ldr	r1, [r1]
	cmp	r1, r3
	ble	.L5
	cmp	r1, r2
	bgt	.L5
	mov	r1, r5
	mov	r0, r6
	bl	dsl_pool_upgrade_clones
	ldr	r3, [r4, #16]
	ldr	r2, [r4, #12]
.L5:
	ldr	r1, .L20+16
	ldr	r1, [r1]
	cmp	r1, r3
	ble	.L6
	cmp	r1, r2
	bgt	.L6
	mov	r1, r5
	mov	r0, r6
	bl	dsl_pool_upgrade_dir_clones
	ldr	r1, [r4]
	ldr	r3, [r4, #16]
	add	r1, r1, #3
	ldr	r2, [r4, #12]
	str	r1, [r4]
.L6:
	ldr	r8, .L20+20
	ldr	r1, [r8]
	cmp	r1, r3
	ble	.L7
	cmp	r1, r2
	bgt	.L9
	mov	r1, r5
	mov	r0, r4
	bl	spa_feature_create_zap_objects
	ldr	r1, [r8]
	ldr	r2, [r4, #12]
.L7:
	cmp	r2, r1
	bge	.L18
.L9:
	ldr	r9, .L20+24
	ldr	r8, .L20+28
	ldr	r2, [r9]
	ldr	r1, [r8]
	ldr	r0, [r4, #8]
	bl	zap_contains
	ldr	r3, .L20+32
	ldr	r3, [r3]
	cmp	r0, r3
	beq	.L19
.L11:
	mov	r0, r6
	ldr	r1, [r7]
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, lr}
	b	rrw_exit
.L18:
	ldr	r8, .L20+36
	mov	r0, r4
	ldr	r1, [r8]
	bl	spa_feature_is_enabled
	ldr	r1, [r8]
	mov	r9, r0
	mov	r0, r4
	bl	spa_feature_is_active
	clz	r3, r0
	cmp	r9, #0
	lsr	r3, r3, #5
	moveq	r3, #0
	cmp	r3, #0
	beq	.L9
	mov	r2, r5
	mov	r0, r4
	ldr	r1, [r8]
	bl	spa_feature_incr
	b	.L9
.L19:
	mov	r0, #4
	str	r5, [sp, #8]
	ldr	r3, [r4, #4]
	ldr	r2, [r9]
	ldr	r1, [r8]
	stm	sp, {r0, r3}
	mov	r3, #1
	ldr	r0, [r4, #8]
	bl	zap_add
	bl	VERIFY0
	b	.L11
.L21:
	.align	2
.L20:
	.word	RW_WRITER
	.word	FTAG
	.word	SPA_VERSION_ORIGIN
	.word	SPA_VERSION_NEXT_CLONES
	.word	SPA_VERSION_DIR_CLONES
	.word	SPA_VERSION_FEATURES
	.word	DMU_POOL_CHECKSUM_SALT
	.word	DMU_POOL_DIRECTORY_OBJECT
	.word	ENOENT
	.word	SPA_FEATURE_LZ4_COMPRESS
	.size	spa_sync_upgrades, .-spa_sync_upgrades
	.comm	SPA_VERSION_ORIGIN,4,4
	.comm	SPA_VERSION_NEXT_CLONES,4,4
	.comm	SPA_VERSION_FEATURES,4,4
	.comm	SPA_VERSION_DIR_CLONES,4,4
	.comm	SPA_FEATURE_LZ4_COMPRESS,4,4
	.comm	RW_WRITER,4,4
	.comm	FTAG,4,4
	.comm	ENOENT,4,4
	.comm	DMU_POOL_DIRECTORY_OBJECT,4,4
	.comm	DMU_POOL_CHECKSUM_SALT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
