	.file	"extr_spi-img-spfi.c_img_spfi_start_pio.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"PIO transfer timed out\n"
	.text
	.p2align 4
	.type	img_spfi_start_pio, @function
img_spfi_start_pio:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15, rdx
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	edi, DWORD PTR [rsi]
	call	spi_master_get_devdata@PLT
	mov	r12, QWORD PTR [r15]
	mov	r13, QWORD PTR 16[r15]
	mov	r14, rax
	test	r12, r12
	je	.L2
	mov	ebx, DWORD PTR 8[r15]
	test	r13, r13
	je	.L16
	mov	ebp, ebx
.L15:
	mov	DWORD PTR 12[rsp], ebp
.L3:
	mov	rdi, r14
	call	spfi_start@PLT
	imul	eax, DWORD PTR 8[r15], 8000
	xor	edx, edx
	div	DWORD PTR 12[r15]
	lea	edi, 100[rax]
	call	msecs_to_jiffies@PLT
	mov	rdi, QWORD PTR jiffies[rip]
	add	rax, rdi
	mov	QWORD PTR [rsp], rax
	mov	eax, DWORD PTR 12[rsp]
	test	eax, eax
	jne	.L4
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L24:
	call	spfi_pio_write32@PLT
	mov	edx, ebp
	mov	rsi, r13
	mov	rdi, r14
	mov	r15d, eax
	cmp	ebp, 3
	jbe	.L8
.L25:
	call	spfi_pio_read32@PLT
.L9:
	mov	edx, r15d
	sub	ebx, r15d
	sub	ebp, eax
	add	r12, rdx
	mov	edx, eax
	xor	eax, eax
	add	r13, rdx
	call	cpu_relax@PLT
	mov	eax, ebx
	or	eax, ebp
	je	.L13
	mov	rdi, QWORD PTR jiffies[rip]
.L4:
	mov	rsi, QWORD PTR [rsp]
	call	time_before@PLT
	test	rax, rax
	je	.L23
	mov	edx, ebx
	mov	rsi, r12
	mov	rdi, r14
	cmp	ebx, 3
	ja	.L24
	call	spfi_pio_write8@PLT
	mov	edx, ebp
	mov	rsi, r13
	mov	rdi, r14
	mov	r15d, eax
	cmp	ebp, 3
	ja	.L25
.L8:
	call	spfi_pio_read8@PLT
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L16:
	mov	DWORD PTR 12[rsp], ebx
	xor	ebp, ebp
	jmp	.L3
.L14:
	mov	rdi, r14
	call	spfi_start@PLT
	imul	eax, DWORD PTR 8[r15], 8000
	xor	edx, edx
	div	DWORD PTR 12[r15]
	lea	edi, 100[rax]
	call	msecs_to_jiffies@PLT
.L13:
	mov	rdi, r14
	call	spfi_wait_all_done@PLT
	mov	edx, 0
	test	eax, eax
	cmovg	eax, edx
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L23:
	.cfi_restore_state
	mov	edi, DWORD PTR [r14]
	lea	rsi, .LC0[rip]
	call	dev_err@PLT
	mov	eax, DWORD PTR ETIMEDOUT[rip]
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	neg	eax
	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
	test	r13, r13
	je	.L14
	mov	ebp, DWORD PTR 8[r15]
	xor	ebx, ebx
	jmp	.L15
	.cfi_endproc
.LFE0:
	.size	img_spfi_start_pio, .-img_spfi_start_pio
	.comm	jiffies,8,8
	.comm	ETIMEDOUT,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_spi-img-spfi.c_img_spfi_start_pio.c"
	.text
	.global	__aeabi_uidiv
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"PIO transfer timed out\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	img_spfi_start_pio, %function
img_spfi_start_pio:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r6, r2
	ldr	r0, [r1]
	bl	spi_master_get_devdata
	ldr	r7, [r6]
	mov	r9, r0
	cmp	r7, #0
	ldr	r8, [r6, #12]
	beq	.L2
	cmp	r8, #0
	ldr	r4, [r6, #4]
	beq	.L16
	mov	r5, r4
.L15:
	mov	r10, r5
.L3:
	mov	r0, r9
	bl	spfi_start
	ldmib	r6, {r0, r1}
	rsb	r3, r0, r0, lsl #5
	add	r0, r0, r3, lsl #2
	lsl	r0, r0, #6
	bl	__aeabi_uidiv
	add	r0, r0, #100
	bl	msecs_to_jiffies
	mov	r3, r0
	ldr	fp, .L25
	cmp	r10, #0
	ldr	r0, [fp]
	add	r10, r3, r0
	bne	.L4
	b	.L13
.L24:
	bl	spfi_pio_write32
	mov	r6, r0
.L7:
	cmp	r5, #3
	mov	r2, r5
	mov	r1, r8
	mov	r0, r9
	bls	.L8
	bl	spfi_pio_read32
.L9:
	sub	r5, r5, r0
	sub	r4, r4, r6
	add	r8, r8, r0
	bl	cpu_relax
	orrs	r3, r4, r5
	add	r7, r7, r6
	beq	.L13
	ldr	r0, [fp]
.L4:
	mov	r1, r10
	bl	time_before
	cmp	r0, #0
	beq	.L23
	cmp	r4, #3
	mov	r2, r4
	mov	r1, r7
	mov	r0, r9
	bhi	.L24
	bl	spfi_pio_write8
	mov	r6, r0
	b	.L7
.L16:
	mov	r10, r4
	mov	r5, r8
	b	.L3
.L8:
	bl	spfi_pio_read8
	b	.L9
.L14:
	bl	spfi_start
	ldr	r3, [r6, #4]
	ldr	r1, [r6, #8]
	rsb	r2, r3, r3, lsl #5
	add	r3, r3, r2, lsl #2
	lsl	r0, r3, #6
	bl	__aeabi_uidiv
	add	r0, r0, #100
	bl	msecs_to_jiffies
.L13:
	mov	r0, r9
	bl	spfi_wait_all_done
	and	r0, r0, r0, asr #31
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L23:
	ldr	r0, [r9]
	ldr	r1, .L25+4
	bl	dev_err
	ldr	r3, .L25+8
	ldr	r0, [r3]
	rsb	r0, r0, #0
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L2:
	cmp	r8, #0
	beq	.L14
	mov	r4, r7
	ldr	r5, [r6, #4]
	b	.L15
.L26:
	.align	2
.L25:
	.word	jiffies
	.word	.LC0
	.word	ETIMEDOUT
	.size	img_spfi_start_pio, .-img_spfi_start_pio
	.comm	jiffies,4,4
	.comm	ETIMEDOUT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
