	.file	"extr_io.c_ubi_io_sync_erase.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"read-only mode"
	.text
	.p2align 4
	.globl	ubi_io_sync_erase
	.type	ubi_io_sync_erase, @function
ubi_io_sync_erase:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	r12d, esi
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdi
	xor	edi, edi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	ebx, edx
	test	esi, esi
	js	.L2
	xor	edi, edi
	cmp	DWORD PTR 0[rbp], esi
	setg	dil
.L2:
	call	ubi_assert@PLT
	mov	esi, r12d
	mov	rdi, rbp
	call	self_check_not_bad@PLT
	test	eax, eax
	jne	.L1
	cmp	QWORD PTR 16[rbp], 0
	jne	.L14
	cmp	QWORD PTR 8[rbp], 0
	jne	.L5
.L8:
	test	ebx, ebx
	je	.L7
	mov	esi, r12d
	mov	rdi, rbp
	call	torture_peb@PLT
	mov	ebx, eax
	test	eax, eax
	js	.L1
.L7:
	mov	esi, r12d
	mov	rdi, rbp
	add	ebx, 1
	call	do_sync_erase@PLT
	test	eax, eax
	cmove	eax, ebx
.L1:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	mov	esi, r12d
	mov	rdi, rbp
	call	nor_erase_prepare@PLT
	test	eax, eax
	je	.L8
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L14:
	mov	rdi, rbp
	lea	rsi, .LC0[rip]
	call	ubi_err@PLT
	mov	eax, DWORD PTR EROFS[rip]
	pop	rbx
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	neg	eax
	ret
	.cfi_endproc
.LFE0:
	.size	ubi_io_sync_erase, .-ubi_io_sync_erase
	.comm	EROFS,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_io.c_ubi_io_sync_erase.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"read-only mode\000"
	.text
	.align	2
	.global	ubi_io_sync_erase
	.syntax unified
	.arm
	.fpu softvfp
	.type	ubi_io_sync_erase, %function
ubi_io_sync_erase:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	subs	r6, r1, #0
	mov	r4, r0
	mov	r5, r2
	movlt	r0, #0
	blt	.L2
	ldr	r0, [r4]
	cmp	r0, r6
	movle	r0, #0
	movgt	r0, #1
.L2:
	bl	ubi_assert
	mov	r1, r6
	mov	r0, r4
	bl	self_check_not_bad
	cmp	r0, #0
	popne	{r4, r5, r6, pc}
	ldr	r3, [r4, #8]
	cmp	r3, #0
	bne	.L14
	ldr	r3, [r4, #4]
	cmp	r3, #0
	bne	.L5
.L8:
	cmp	r5, #0
	beq	.L7
	mov	r1, r6
	mov	r0, r4
	bl	torture_peb
	subs	r5, r0, #0
	blt	.L10
.L7:
	mov	r1, r6
	mov	r0, r4
	bl	do_sync_erase
	cmp	r0, #0
	addeq	r0, r5, #1
	pop	{r4, r5, r6, pc}
.L5:
	mov	r1, r6
	mov	r0, r4
	bl	nor_erase_prepare
	cmp	r0, #0
	beq	.L8
	pop	{r4, r5, r6, pc}
.L10:
	mov	r0, r5
	pop	{r4, r5, r6, pc}
.L14:
	mov	r0, r4
	ldr	r1, .L15
	bl	ubi_err
	ldr	r3, .L15+4
	ldr	r0, [r3]
	rsb	r0, r0, #0
	pop	{r4, r5, r6, pc}
.L16:
	.align	2
.L15:
	.word	.LC0
	.word	EROFS
	.size	ubi_io_sync_erase, .-ubi_io_sync_erase
	.comm	EROFS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
