	.file	"extr_spi-img-spfi.c_img_spfi_start_dma.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	img_spfi_start_dma, @function
img_spfi_start_dma:
.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, rdx
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 104
	.cfi_def_cfa_offset 144
	mov	edi, DWORD PTR [rsi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 88[rsp], rax
	xor	eax, eax
	call	spi_master_get_devdata@PLT
	cmp	QWORD PTR 16[rbp], 0
	mov	QWORD PTR [rax], 0
	mov	rbx, rax
	je	.L2
	mov	rax, QWORD PTR DMA_DEV_TO_MEM[rip]
	mov	QWORD PTR 24[rsp], rax
	mov	rax, QWORD PTR 16[rbx]
	test	BYTE PTR 0[rbp], 3
	je	.L24
	add	rax, QWORD PTR SPFI_RX_8BIT_VALID_DATA[rip]
	mov	QWORD PTR 32[rsp], rax
	movabs	rax, 17179869185
	mov	QWORD PTR [rsp], rax
.L4:
	mov	edi, DWORD PTR 12[rbx]
	mov	rsi, rsp
	call	dmaengine_slave_config@PLT
	mov	edx, DWORD PTR 32[rbp]
	mov	esi, DWORD PTR 36[rbp]
	mov	edi, DWORD PTR 12[rbx]
	mov	r8d, DWORD PTR DMA_PREP_INTERRUPT[rip]
	mov	rcx, QWORD PTR DMA_DEV_TO_MEM[rip]
	call	dmaengine_prep_slave_sg@PLT
	mov	r12, rax
	test	rax, rax
	je	.L5
	mov	eax, DWORD PTR img_spfi_dma_rx_cb[rip]
	cmp	QWORD PTR 8[rbp], 0
	mov	QWORD PTR [r12], rbx
	mov	DWORD PTR 8[r12], eax
	jne	.L11
	xor	r13d, r13d
	cmp	QWORD PTR 16[rbp], 0
	jne	.L25
	.p2align 4,,10
	.p2align 3
.L9:
	mov	rdi, rbx
	mov	r12d, 1
	call	spfi_start@PLT
	cmp	QWORD PTR 8[rbp], 0
	jne	.L26
.L1:
	mov	rax, QWORD PTR 88[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L27
	add	rsp, 104
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	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
.L2:
	.cfi_restore_state
	xor	r13d, r13d
	cmp	QWORD PTR 8[rbp], 0
	je	.L9
	xor	r12d, r12d
.L11:
	mov	rax, QWORD PTR DMA_MEM_TO_DEV[rip]
	mov	QWORD PTR 72[rsp], rax
	mov	rax, QWORD PTR 16[rbx]
	test	BYTE PTR 0[rbp], 3
	jne	.L7
	add	rax, QWORD PTR SPFI_TX_32BIT_VALID_DATA[rip]
	mov	QWORD PTR 64[rsp], rax
	movabs	rax, 17179869188
	mov	QWORD PTR 56[rsp], rax
.L8:
	mov	edi, DWORD PTR 8[rbx]
	lea	rsi, 48[rsp]
	call	dmaengine_slave_config@PLT
	mov	edx, DWORD PTR 24[rbp]
	mov	esi, DWORD PTR 28[rbp]
	mov	edi, DWORD PTR 8[rbx]
	mov	r8d, DWORD PTR DMA_PREP_INTERRUPT[rip]
	mov	rcx, QWORD PTR DMA_MEM_TO_DEV[rip]
	call	dmaengine_prep_slave_sg@PLT
	mov	r13, rax
	test	rax, rax
	je	.L5
	mov	eax, DWORD PTR img_spfi_dma_tx_cb[rip]
	cmp	QWORD PTR 16[rbp], 0
	mov	QWORD PTR 0[r13], rbx
	mov	DWORD PTR 8[r13], eax
	je	.L9
.L25:
	mov	DWORD PTR [rbx], 1
	mov	rdi, r12
	call	dmaengine_submit@PLT
	mov	edi, DWORD PTR 12[rbx]
	call	dma_async_issue_pending@PLT
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L24:
	add	rax, QWORD PTR SPFI_RX_32BIT_VALID_DATA[rip]
	mov	QWORD PTR 32[rsp], rax
	movabs	rax, 17179869188
	mov	QWORD PTR [rsp], rax
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L26:
	mov	DWORD PTR 4[rbx], 1
	mov	rdi, r13
	call	dmaengine_submit@PLT
	mov	edi, DWORD PTR 8[rbx]
	call	dma_async_issue_pending@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L7:
	add	rax, QWORD PTR SPFI_TX_8BIT_VALID_DATA[rip]
	mov	QWORD PTR 64[rsp], rax
	movabs	rax, 17179869185
	mov	QWORD PTR 56[rsp], rax
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L5:
	mov	edi, DWORD PTR 12[rbx]
	call	dmaengine_terminate_all@PLT
	mov	edi, DWORD PTR 8[rbx]
	call	dmaengine_terminate_all@PLT
	mov	r12d, DWORD PTR EIO[rip]
	neg	r12d
	jmp	.L1
.L27:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	img_spfi_start_dma, .-img_spfi_start_dma
	.comm	img_spfi_dma_tx_cb,4,4
	.comm	img_spfi_dma_rx_cb,4,4
	.comm	SPFI_TX_8BIT_VALID_DATA,8,8
	.comm	SPFI_TX_32BIT_VALID_DATA,8,8
	.comm	SPFI_RX_8BIT_VALID_DATA,8,8
	.comm	SPFI_RX_32BIT_VALID_DATA,8,8
	.comm	EIO,4,4
	.comm	DMA_PREP_INTERRUPT,4,4
	.comm	DMA_MEM_TO_DEV,8,8
	.comm	DMA_DEV_TO_MEM,8,8
	.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_dma.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	img_spfi_start_dma, %function
img_spfi_start_dma:
	@ args = 0, pretend = 0, frame = 64
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r3, .L29
	mov	r5, r2
	sub	sp, sp, #72
	ldr	r0, [r1]
	ldr	r3, [r3]
	str	r3, [sp, #68]
	mov	r3,#0
	bl	spi_master_get_devdata
	mov	r2, #0
	ldr	r3, [r5, #8]
	mov	r4, r0
	cmp	r3, r2
	str	r2, [r0]
	str	r2, [r0, #4]
	beq	.L2
	ldr	r2, [r5]
	ldr	r6, .L29+4
	tst	r2, #3
	moveq	r1, #4
	ldr	r2, [r0, #16]
	movne	r1, #4
	movne	r0, #1
	ldr	r3, [r6]
	ldr	r8, .L29+8
	str	r3, [sp, #32]
	ldreq	r3, .L29+12
	ldrne	r3, .L29+16
	streq	r1, [sp, #12]
	ldr	r3, [r3]
	strne	r0, [sp, #12]
	add	r3, r3, r2
	str	r1, [sp, #16]
	ldr	r0, [r4, #12]
	add	r1, sp, #12
	str	r3, [sp, #36]
	bl	dmaengine_slave_config
	ldr	r2, [r8]
	ldr	r0, [r4, #12]
	ldr	r3, [r6]
	str	r2, [sp]
	ldr	r2, [r5, #20]
	ldr	r1, [r5, #24]
	bl	dmaengine_prep_slave_sg
	subs	r7, r0, #0
	beq	.L5
	ldr	r3, .L29+20
	ldr	r6, [r5, #4]
	ldr	r3, [r3]
	cmp	r6, #0
	str	r3, [r7, #4]
	str	r4, [r7]
	beq	.L6
.L11:
	ldr	r2, [r5]
	ldr	r6, .L29+24
	tst	r2, #3
	moveq	r1, #4
	movne	r0, #1
	movne	r1, #4
	ldr	r3, [r6]
	ldr	r2, [r4, #16]
	str	r3, [sp, #60]
	ldreq	r3, .L29+28
	ldrne	r3, .L29+32
	streq	r1, [sp, #48]
	ldr	r3, [r3]
	strne	r0, [sp, #48]
	add	r3, r3, r2
	str	r1, [sp, #52]
	ldr	r0, [r4, #8]
	add	r1, sp, #40
	str	r3, [sp, #56]
	bl	dmaengine_slave_config
	ldr	r2, [r8]
	ldr	r3, [r6]
	ldr	r0, [r4, #8]
	str	r2, [sp]
	ldr	r2, [r5, #12]
	ldr	r1, [r5, #16]
	bl	dmaengine_prep_slave_sg
	subs	r6, r0, #0
	beq	.L5
	ldr	r3, .L29+36
	ldr	r3, [r3]
	str	r4, [r6]
	str	r3, [r6, #4]
.L6:
	ldr	r3, [r5, #8]
	cmp	r3, #0
	beq	.L9
	mov	r3, #1
	mov	r0, r7
	str	r3, [r4]
	bl	dmaengine_submit
	ldr	r0, [r4, #12]
	bl	dma_async_issue_pending
.L9:
	mov	r0, r4
	bl	spfi_start
	ldr	r3, [r5, #4]
	cmp	r3, #0
	moveq	r0, #1
	bne	.L27
.L1:
	ldr	r3, .L29
	ldr	r2, [r3]
	ldr	r3, [sp, #68]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L28
	add	sp, sp, #72
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L2:
	ldr	r6, [r5, #4]
	cmp	r6, #0
	beq	.L9
	mov	r7, r3
	ldr	r8, .L29+8
	b	.L11
.L27:
	mov	r5, #1
	mov	r0, r6
	str	r5, [r4, #4]
	bl	dmaengine_submit
	ldr	r0, [r4, #8]
	bl	dma_async_issue_pending
	mov	r0, r5
	b	.L1
.L5:
	ldr	r0, [r4, #12]
	bl	dmaengine_terminate_all
	ldr	r0, [r4, #8]
	bl	dmaengine_terminate_all
	ldr	r3, .L29+40
	ldr	r0, [r3]
	rsb	r0, r0, #0
	b	.L1
.L28:
	bl	__stack_chk_fail
.L30:
	.align	2
.L29:
	.word	.LC0
	.word	DMA_DEV_TO_MEM
	.word	DMA_PREP_INTERRUPT
	.word	SPFI_RX_32BIT_VALID_DATA
	.word	SPFI_RX_8BIT_VALID_DATA
	.word	img_spfi_dma_rx_cb
	.word	DMA_MEM_TO_DEV
	.word	SPFI_TX_32BIT_VALID_DATA
	.word	SPFI_TX_8BIT_VALID_DATA
	.word	img_spfi_dma_tx_cb
	.word	EIO
	.size	img_spfi_start_dma, .-img_spfi_start_dma
	.comm	img_spfi_dma_tx_cb,4,4
	.comm	img_spfi_dma_rx_cb,4,4
	.comm	SPFI_TX_8BIT_VALID_DATA,4,4
	.comm	SPFI_TX_32BIT_VALID_DATA,4,4
	.comm	SPFI_RX_8BIT_VALID_DATA,4,4
	.comm	SPFI_RX_32BIT_VALID_DATA,4,4
	.comm	EIO,4,4
	.comm	DMA_PREP_INTERRUPT,4,4
	.comm	DMA_MEM_TO_DEV,4,4
	.comm	DMA_DEV_TO_MEM,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
