	.file	"extr_at91_mci.c_at91_mci_pre_dma_read.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"pre dma read\n"
.LC1:
	.string	"no command\n"
.LC2:
	.string	"no data\n"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC3:
	.string	"Nothing left to transfer (index = %d)\n"
	.section	.rodata.str1.1
.LC4:
	.string	"Transfer active in current\n"
.LC5:
	.string	"Transfer active in next\n"
.LC6:
	.string	"Using transfer index %d\n"
.LC7:
	.string	"sg = %p\n"
	.section	.rodata.str1.8
	.align 8
.LC8:
	.string	"dma address = %08X, length = %d\n"
	.section	.rodata.str1.1
.LC9:
	.string	"pre dma read done\n"
	.text
	.p2align 4
	.type	at91_mci_pre_dma_read, @function
at91_mci_pre_dma_read:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xor	eax, eax
	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
	mov	rbx, rdi
	lea	rdi, .LC0[rip]
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	call	pr_debug@PLT
	mov	rax, QWORD PTR 8[rbx]
	lea	rdi, .LC1[rip]
	test	rax, rax
	je	.L28
	mov	r13, QWORD PTR [rax]
	xor	r12d, r12d
	lea	r14, .LC6[rip]
	lea	rdi, .LC2[rip]
	test	r13, r13
	je	.L29
.L3:
	mov	rsi, QWORD PTR [rbx]
	cmp	rsi, QWORD PTR 0[r13]
	jge	.L31
	test	r12d, r12d
	je	.L32
	mov	esi, DWORD PTR ATMEL_PDC_RNCR[rip]
	mov	rdi, rbx
	call	at91_mci_read@PLT
	test	rax, rax
	jne	.L33
.L7:
	mov	rsi, QWORD PTR [rbx]
	mov	rdi, r14
	xor	eax, eax
	call	pr_debug@PLT
	mov	rax, QWORD PTR [rbx]
	mov	rdx, QWORD PTR 16[r13]
	lea	rdi, .LC7[rip]
	lea	rcx, 1[rax]
	lea	rax, [rax+rax*2]
	mov	QWORD PTR [rbx], rcx
	lea	rbp, [rdx+rax*4]
	xor	eax, eax
	mov	rsi, rbp
	call	pr_debug@PLT
	mov	ecx, DWORD PTR 4[rbp]
	mov	r15d, DWORD PTR 8[rbp]
	mov	rdi, rbp
	mov	r8d, DWORD PTR DMA_FROM_DEVICE[rip]
	mov	DWORD PTR 8[rsp], ecx
	mov	DWORD PTR 12[rsp], r8d
	call	sg_page@PLT
	mov	r8d, DWORD PTR 12[rsp]
	mov	ecx, DWORD PTR 8[rsp]
	xor	edi, edi
	mov	esi, eax
	mov	edx, r15d
	call	dma_map_page@PLT
	mov	edx, DWORD PTR 4[rbp]
	lea	rdi, .LC8[rip]
	mov	DWORD PTR 0[rbp], eax
	mov	esi, eax
	xor	eax, eax
	call	pr_debug@PLT
	mov	edx, DWORD PTR 0[rbp]
	test	r12d, r12d
	je	.L34
	mov	esi, DWORD PTR ATMEL_PDC_RNPR[rip]
	mov	rdi, rbx
	call	at91_mci_write@PLT
	test	BYTE PTR 8[r13], 3
	jne	.L35
	mov	eax, DWORD PTR 4[rbp]
	test	eax, eax
	lea	edx, 3[rax]
	cmovns	edx, eax
	sar	edx, 2
.L14:
	mov	esi, DWORD PTR ATMEL_PDC_RNCR[rip]
	mov	rdi, rbx
	call	at91_mci_write@PLT
.L9:
	cmp	r12d, 1
	jne	.L15
.L5:
	lea	rdi, .LC9[rip]
.L29:
	xor	eax, eax
.L28:
	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
	jmp	pr_debug@PLT
	.p2align 4,,10
	.p2align 3
.L35:
	.cfi_restore_state
	mov	edx, DWORD PTR 4[rbp]
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L34:
	mov	esi, DWORD PTR ATMEL_PDC_RPR[rip]
	mov	rdi, rbx
	call	at91_mci_write@PLT
	test	BYTE PTR 8[r13], 3
	je	.L11
	mov	edx, DWORD PTR 4[rbp]
.L12:
	mov	esi, DWORD PTR ATMEL_PDC_RCR[rip]
	mov	rdi, rbx
	call	at91_mci_write@PLT
.L15:
	add	r12d, 1
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L32:
	mov	esi, DWORD PTR ATMEL_PDC_RCR[rip]
	mov	rdi, rbx
	call	at91_mci_read@PLT
	test	rax, rax
	je	.L7
	lea	rdi, .LC4[rip]
	xor	eax, eax
	call	pr_debug@PLT
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L11:
	mov	eax, DWORD PTR 4[rbp]
	test	eax, eax
	lea	edx, 3[rax]
	cmovns	edx, eax
	sar	edx, 2
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L33:
	lea	rdi, .LC5[rip]
	xor	eax, eax
	call	pr_debug@PLT
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L31:
	lea	rdi, .LC3[rip]
	xor	eax, eax
	call	pr_debug@PLT
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	at91_mci_pre_dma_read, .-at91_mci_pre_dma_read
	.comm	DMA_FROM_DEVICE,4,4
	.comm	ATMEL_PDC_RPR,4,4
	.comm	ATMEL_PDC_RNPR,4,4
	.comm	ATMEL_PDC_RNCR,4,4
	.comm	ATMEL_PDC_RCR,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_at91_mci.c_at91_mci_pre_dma_read.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"pre dma read\012\000"
	.align	2
.LC1:
	.ascii	"no command\012\000"
	.align	2
.LC2:
	.ascii	"no data\012\000"
	.align	2
.LC3:
	.ascii	"Nothing left to transfer (index = %d)\012\000"
	.align	2
.LC4:
	.ascii	"Transfer active in current\012\000"
	.align	2
.LC5:
	.ascii	"Transfer active in next\012\000"
	.align	2
.LC6:
	.ascii	"Using transfer index %d\012\000"
	.align	2
.LC7:
	.ascii	"sg = %p\012\000"
	.align	2
.LC8:
	.ascii	"dma address = %08X, length = %d\012\000"
	.align	2
.LC9:
	.ascii	"pre dma read done\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	at91_mci_pre_dma_read, %function
at91_mci_pre_dma_read:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, r0
	sub	sp, sp, #12
	ldr	r0, .L33
	bl	pr_debug
	ldr	r3, [r4, #4]
	cmp	r3, #0
	ldreq	r0, .L33+4
	beq	.L27
	ldr	r7, [r3]
	cmp	r7, #0
	ldreq	r0, .L33+8
	beq	.L27
	mov	r6, #0
	ldr	fp, .L33+12
	ldr	r10, .L33+16
.L3:
	ldr	r1, [r4]
	ldr	r3, [r7]
	cmp	r1, r3
	bge	.L29
	cmp	r6, #0
	beq	.L30
	ldr	r3, .L33+20
	mov	r0, r4
	ldr	r1, [r3]
	bl	at91_mci_read
	cmp	r0, #0
	bne	.L31
.L7:
	ldr	r1, [r4]
	mov	r0, fp
	bl	pr_debug
	ldr	r3, [r4]
	ldr	r8, [r7, #8]
	add	r9, r3, r3, lsl #1
	add	r5, r8, r9, lsl #2
	add	r3, r3, #1
	mov	r1, r5
	str	r3, [r4]
	ldr	r0, .L33+24
	bl	pr_debug
	mov	r0, r5
	bl	sg_page
	ldr	ip, [r10]
	mov	r1, r0
	ldr	r3, [r5, #4]
	ldr	r2, [r5, #8]
	mov	r0, #0
	str	ip, [sp]
	bl	dma_map_page
	ldr	r2, [r5, #4]
	mov	r1, r0
	str	r0, [r8, r9, lsl #2]
	ldr	r0, .L33+28
	bl	pr_debug
	cmp	r6, #0
	beq	.L32
	ldr	r3, .L33+32
	ldr	r2, [r8, r9, lsl #2]
	ldr	r1, [r3]
	mov	r0, r4
	bl	at91_mci_write
	ldr	r3, [r7, #4]
	ldr	r2, .L33+20
	tst	r3, #3
	ldr	r1, [r2]
	ldr	r2, [r5, #4]
	beq	.L13
.L14:
	mov	r0, r4
	bl	at91_mci_write
.L9:
	cmp	r6, #1
	bne	.L15
.L5:
	ldr	r0, .L33+36
.L27:
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	pr_debug
.L32:
	ldr	r3, .L33+40
	ldr	r2, [r8, r9, lsl #2]
	ldr	r1, [r3]
	mov	r0, r4
	bl	at91_mci_write
	ldr	r2, [r7, #4]
	ldr	r3, .L33+44
	tst	r2, #3
	ldr	r1, [r3]
	ldr	r2, [r5, #4]
	bne	.L12
	add	r3, r2, #3
	cmp	r2, #0
	movlt	r2, r3
	asr	r2, r2, #2
.L12:
	mov	r0, r4
	bl	at91_mci_write
.L15:
	add	r6, r6, #1
	b	.L3
.L13:
	add	r3, r2, #3
	cmp	r2, #0
	movlt	r2, r3
	asr	r2, r2, #2
	b	.L14
.L30:
	ldr	r3, .L33+44
	mov	r0, r4
	ldr	r1, [r3]
	bl	at91_mci_read
	cmp	r0, #0
	beq	.L7
	ldr	r0, .L33+48
	bl	pr_debug
	b	.L15
.L31:
	ldr	r0, .L33+52
	bl	pr_debug
	b	.L9
.L29:
	ldr	r0, .L33+56
	bl	pr_debug
	b	.L5
.L34:
	.align	2
.L33:
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC6
	.word	DMA_FROM_DEVICE
	.word	ATMEL_PDC_RNCR
	.word	.LC7
	.word	.LC8
	.word	ATMEL_PDC_RNPR
	.word	.LC9
	.word	ATMEL_PDC_RPR
	.word	ATMEL_PDC_RCR
	.word	.LC4
	.word	.LC5
	.word	.LC3
	.size	at91_mci_pre_dma_read, .-at91_mci_pre_dma_read
	.comm	DMA_FROM_DEVICE,4,4
	.comm	ATMEL_PDC_RPR,4,4
	.comm	ATMEL_PDC_RNPR,4,4
	.comm	ATMEL_PDC_RNCR,4,4
	.comm	ATMEL_PDC_RCR,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
