	.file	"extr_docg3.c_doc_write_erase_wait_status.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"Timeout reached and the chip is still not ready\n"
	.align 8
.LC1:
	.string	"Erase/Write failed on (a) plane(s), status = %x\n"
	.text
	.p2align 4
	.type	doc_write_erase_wait_status, @function
doc_write_erase_wait_status:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rdi, rbp
	xor	ebx, ebx
	call	doc_is_ready@PLT
	test	eax, eax
	jne	.L7
.L16:
	cmp	ebx, 5
	je	.L7
	mov	edi, 20
	add	ebx, 1
	call	msleep@PLT
	mov	rdi, rbp
	call	doc_is_ready@PLT
	test	eax, eax
	je	.L16
.L7:
	mov	rdi, rbp
	call	doc_is_ready@PLT
	test	eax, eax
	je	.L17
	mov	rdi, rbp
	call	doc_get_op_status@PLT
	mov	r12d, eax
	and	r12d, DWORD PTR DOC_PLANES_STATUS_FAIL[rip]
	jne	.L18
.L6:
	endbr64
	mov	rdi, rbp
	call	doc_page_finish@PLT
	mov	eax, r12d
	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
.L18:
	.cfi_restore_state
	mov	esi, eax
	lea	rdi, .LC1[rip]
	xor	eax, eax
	call	doc_dbg@PLT
	mov	r12d, DWORD PTR EIO[rip]
	mov	rdi, rbp
	call	doc_page_finish@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	neg	r12d
	mov	eax, r12d
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	lea	rdi, .LC0[rip]
	call	doc_dbg@PLT
	mov	r12d, DWORD PTR EAGAIN[rip]
	mov	rdi, rbp
	call	doc_page_finish@PLT
	pop	rbx
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	neg	r12d
	mov	eax, r12d
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	doc_write_erase_wait_status, .-doc_write_erase_wait_status
	.comm	EIO,4,4
	.comm	EAGAIN,4,4
	.comm	DOC_PLANES_STATUS_FAIL,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_docg3.c_doc_write_erase_wait_status.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Timeout reached and the chip is still not ready\012"
	.ascii	"\000"
	.align	2
.LC1:
	.ascii	"Erase/Write failed on (a) plane(s), status = %x\012"
	.ascii	"\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	doc_write_erase_wait_status, %function
doc_write_erase_wait_status:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	mov	r4, #0
	mov	r5, r0
.L2:
	mov	r0, r5
	bl	doc_is_ready
	subs	r3, r4, #5
	movne	r3, #1
	cmp	r0, #0
	movne	r3, #0
	cmp	r3, #0
	beq	.L11
	mov	r0, #20
	bl	msleep
	add	r4, r4, #1
	b	.L2
.L11:
	mov	r0, r5
	bl	doc_is_ready
	cmp	r0, #0
	beq	.L12
	mov	r0, r5
	bl	doc_get_op_status
	ldr	r3, .L14
	ldr	r4, [r3]
	ands	r4, r0, r4
	bne	.L13
.L5:
	mov	r0, r5
	bl	doc_page_finish
	mov	r0, r4
	pop	{r4, r5, r6, pc}
.L13:
	mov	r1, r0
	ldr	r0, .L14+4
	bl	doc_dbg
	ldr	r3, .L14+8
	ldr	r4, [r3]
	rsb	r4, r4, #0
	b	.L5
.L12:
	ldr	r0, .L14+12
	bl	doc_dbg
	ldr	r3, .L14+16
	ldr	r4, [r3]
	rsb	r4, r4, #0
	b	.L5
.L15:
	.align	2
.L14:
	.word	DOC_PLANES_STATUS_FAIL
	.word	.LC1
	.word	EIO
	.word	.LC0
	.word	EAGAIN
	.size	doc_write_erase_wait_status, .-doc_write_erase_wait_status
	.comm	EIO,4,4
	.comm	EAGAIN,4,4
	.comm	DOC_PLANES_STATUS_FAIL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
