	.file	"extr_io.c_torture_peb.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"run torture test for PEB %d"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"erased PEB %d, but a non-0xFF byte found"
	.align 8
.LC2:
	.string	"pattern %x checking failed for PEB %d"
	.align 8
.LC3:
	.string	"PEB %d passed torture test, do not mark it as bad"
	.align 8
.LC4:
	.string	"read problems on freshly erased PEB %d, must be bad"
	.text
	.p2align 4
	.type	torture_peb, @function
torture_peb:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	edx, esi
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13d, esi
	lea	rsi, .LC0[rip]
	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, 8
	.cfi_def_cfa_offset 64
	call	ubi_msg@PLT
	mov	rdi, QWORD PTR patterns[rip]
	call	ARRAY_SIZE@PLT
	xor	edi, edi
	test	eax, eax
	mov	r15d, eax
	setg	dil
	call	ubi_assert@PLT
	mov	rdi, rbp
	call	mutex_lock@PLT
	test	r15d, r15d
	jle	.L2
	lea	eax, -1[r15]
	xor	ebx, ebx
	lea	r14, 4[0+rax*4]
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L15:
	mov	esi, DWORD PTR 8[rbp]
	mov	r8d, DWORD PTR 4[rbp]
	xor	ecx, ecx
	mov	edx, r13d
	mov	rdi, rbp
	call	ubi_io_read@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L3
	mov	edx, DWORD PTR 4[rbp]
	mov	edi, DWORD PTR 8[rbp]
	mov	esi, 255
	call	ubi_check_pattern@PLT
	test	eax, eax
	je	.L13
	mov	rax, QWORD PTR patterns[rip]
	mov	edx, DWORD PTR 4[rbp]
	mov	edi, DWORD PTR 8[rbp]
	mov	esi, DWORD PTR [rax+rbx]
	call	memset@PLT
	mov	esi, DWORD PTR 8[rbp]
	mov	r8d, DWORD PTR 4[rbp]
	xor	ecx, ecx
	mov	edx, r13d
	mov	rdi, rbp
	call	ubi_io_write@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L3
	mov	rax, QWORD PTR patterns[rip]
	mov	edx, DWORD PTR 4[rbp]
	mov	edi, DWORD PTR 8[rbp]
	mov	esi, DWORD PTR [rax+rbx]
	not	esi
	call	memset@PLT
	mov	esi, DWORD PTR 8[rbp]
	mov	r8d, DWORD PTR 4[rbp]
	xor	ecx, ecx
	mov	edx, r13d
	mov	rdi, rbp
	call	ubi_io_read@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L3
	mov	rax, QWORD PTR patterns[rip]
	mov	edx, DWORD PTR 4[rbp]
	mov	edi, DWORD PTR 8[rbp]
	mov	esi, DWORD PTR [rax+rbx]
	call	ubi_check_pattern@PLT
	test	eax, eax
	je	.L14
	add	rbx, 4
	cmp	rbx, r14
	je	.L2
.L6:
	mov	esi, r13d
	mov	rdi, rbp
	call	do_sync_erase@PLT
	mov	r12d, eax
	test	eax, eax
	je	.L15
	.p2align 4,,10
	.p2align 3
.L3:
	mov	rdi, rbp
	call	mutex_unlock@PLT
	cmp	DWORD PTR UBI_IO_BITFLIPS[rip], r12d
	je	.L9
	mov	edi, r12d
	call	mtd_is_eccerr@PLT
	test	rax, rax
	je	.L1
.L9:
	mov	edx, r13d
	lea	rsi, .LC4[rip]
	mov	rdi, rbp
	xor	eax, eax
	call	ubi_err@PLT
	mov	r12d, DWORD PTR EIO[rip]
	neg	r12d
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	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
.L2:
	.cfi_restore_state
	mov	edx, r13d
	lea	rsi, .LC3[rip]
	mov	rdi, rbp
	mov	r12d, r15d
	call	ubi_msg@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L13:
	mov	edx, r13d
	lea	rsi, .LC1[rip]
	mov	rdi, rbp
	call	ubi_err@PLT
	mov	r12d, DWORD PTR EIO[rip]
	neg	r12d
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L14:
	mov	rax, QWORD PTR patterns[rip]
	mov	ecx, r13d
	lea	rsi, .LC2[rip]
	mov	rdi, rbp
	mov	edx, DWORD PTR [rax+rbx]
	xor	eax, eax
	call	ubi_err@PLT
	mov	r12d, DWORD PTR EIO[rip]
	neg	r12d
	jmp	.L3
	.cfi_endproc
.LFE0:
	.size	torture_peb, .-torture_peb
	.comm	patterns,8,8
	.comm	UBI_IO_BITFLIPS,4,4
	.comm	EIO,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_torture_peb.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"run torture test for PEB %d\000"
	.align	2
.LC1:
	.ascii	"erased PEB %d, but a non-0xFF byte found\000"
	.align	2
.LC2:
	.ascii	"pattern %x checking failed for PEB %d\000"
	.align	2
.LC3:
	.ascii	"PEB %d passed torture test, do not mark it as bad\000"
	.align	2
.LC4:
	.ascii	"read problems on freshly erased PEB %d, must be bad"
	.ascii	"\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	torture_peb, %function
torture_peb:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r8, .L16
	mov	r2, r1
	sub	sp, sp, #8
	mov	r7, r1
	ldr	r1, .L16+4
	mov	r5, r0
	bl	ubi_msg
	ldr	r0, [r8]
	bl	ARRAY_SIZE
	subs	r9, r0, #0
	movle	r0, #0
	movgt	r0, #1
	bl	ubi_assert
	mov	r0, r5
	bl	mutex_lock
	cmp	r9, #0
	ble	.L2
	mov	r6, #0
	b	.L6
.L15:
	ldr	r2, [r5, #4]
	mov	r3, r4
	str	r2, [sp]
	mov	r0, r5
	mov	r2, r7
	ldr	r1, [r5, #8]
	bl	ubi_io_read
	subs	r4, r0, #0
	bne	.L3
	mov	r1, #255
	ldr	r2, [r5, #4]
	ldr	r0, [r5, #8]
	bl	ubi_check_pattern
	cmp	r0, #0
	beq	.L13
	ldr	r3, [r8]
	ldr	r2, [r5, #4]
	ldr	r1, [r3, r6, lsl #2]
	ldr	r0, [r5, #8]
	bl	memset
	ldr	r2, [r5, #4]
	mov	r3, r4
	str	r2, [sp]
	mov	r0, r5
	mov	r2, r7
	ldr	r1, [r5, #8]
	bl	ubi_io_write
	subs	r4, r0, #0
	lsl	r10, r6, #2
	bne	.L3
	ldr	r3, [r8]
	ldr	r2, [r5, #4]
	ldr	r1, [r3, r6, lsl #2]
	ldr	r0, [r5, #8]
	mvn	r1, r1
	bl	memset
	ldr	r2, [r5, #4]
	mov	r3, r4
	str	r2, [sp]
	mov	r0, r5
	mov	r2, r7
	ldr	r1, [r5, #8]
	bl	ubi_io_read
	subs	r4, r0, #0
	add	r6, r6, #1
	bne	.L3
	ldr	r3, [r8]
	ldr	r2, [r5, #4]
	ldr	r1, [r3, r10]
	ldr	r0, [r5, #8]
	bl	ubi_check_pattern
	cmp	r0, #0
	beq	.L14
	cmp	r9, r6
	beq	.L2
.L6:
	mov	r1, r7
	mov	r0, r5
	bl	do_sync_erase
	subs	r4, r0, #0
	beq	.L15
.L3:
	mov	r0, r5
	bl	mutex_unlock
	ldr	r3, .L16+8
	ldr	r3, [r3]
	cmp	r3, r4
	beq	.L9
	mov	r0, r4
	bl	mtd_is_eccerr
	cmp	r0, #0
	beq	.L1
.L9:
	mov	r2, r7
	mov	r0, r5
	ldr	r1, .L16+12
	bl	ubi_err
	ldr	r3, .L16+16
	ldr	r0, [r3]
	rsb	r4, r0, #0
.L1:
	mov	r0, r4
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L2:
	mov	r2, r7
	mov	r0, r5
	ldr	r1, .L16+20
	mov	r4, r9
	bl	ubi_msg
	b	.L3
.L13:
	mov	r2, r7
	mov	r0, r5
	ldr	r1, .L16+24
	bl	ubi_err
	ldr	r3, .L16+16
	ldr	r0, [r3]
	rsb	r4, r0, #0
	b	.L3
.L14:
	ldr	r2, [r8]
	mov	r3, r7
	mov	r0, r5
	ldr	r2, [r2, r10]
	ldr	r1, .L16+28
	bl	ubi_err
	ldr	r3, .L16+16
	ldr	r0, [r3]
	rsb	r4, r0, #0
	b	.L3
.L17:
	.align	2
.L16:
	.word	patterns
	.word	.LC0
	.word	UBI_IO_BITFLIPS
	.word	.LC4
	.word	EIO
	.word	.LC3
	.word	.LC1
	.word	.LC2
	.size	torture_peb, .-torture_peb
	.comm	patterns,4,4
	.comm	UBI_IO_BITFLIPS,4,4
	.comm	EIO,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
