	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function at91_mci_pre_dma_read
_at91_mci_pre_dma_read:                 ## @at91_mci_pre_dma_read
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_debug
	movq	8(%r15), %rax
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	(%rax), %r13
	testq	%r13, %r13
	je	LBB0_3
## %bb.4:
	movq	(%r15), %rsi
	cmpq	(%r13), %rsi
	jge	LBB0_10
## %bb.5:
	movb	$1, %bl
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	_ATMEL_PDC_RCR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_at91_mci_write
LBB0_9:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	(%r15), %rsi
	xorl	%ebx, %ebx
	cmpq	(%r13), %rsi
	jge	LBB0_10
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	testb	$1, %bl
	je	LBB0_11
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	_ATMEL_PDC_RCR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_at91_mci_read
	testq	%rax, %rax
	je	LBB0_13
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_debug
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	_ATMEL_PDC_RNCR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_at91_mci_read
	testq	%rax, %rax
	jne	LBB0_12
LBB0_13:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	(%r15), %rsi
	leaq	L_.str.6(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_debug
	movq	16(%r13), %r12
	movq	(%r15), %rax
	leaq	1(%rax), %rcx
	movq	%rcx, (%r15)
	leaq	(%rax,%rax,2), %r15
	leaq	(%r12,%r15,4), %r14
	leaq	L_.str.7(%rip), %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_pr_debug
	movq	%r14, %rdi
	callq	_sg_page
	movl	4(%r12,%r15,4), %ecx
	movl	8(%r12,%r15,4), %edx
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rsi
	movl	(%rsi), %r8d
	xorl	%edi, %edi
	movl	%eax, %esi
	callq	_dma_map_page
	movl	%eax, (%r12,%r15,4)
	movl	4(%r12,%r15,4), %edx
	leaq	L_.str.8(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_pr_debug
	testb	$1, %bl
	je	LBB0_17
## %bb.14:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	_ATMEL_PDC_RPR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r14), %edx
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	callq	_at91_mci_write
	testb	$3, 8(%r13)
	movl	4(%r14), %edx
	jne	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_6 Depth=1
	leal	3(%rdx), %eax
	testl	%edx, %edx
	cmovnsl	%edx, %eax
	sarl	$2, %eax
	movl	%eax, %edx
	jmp	LBB0_16
LBB0_1:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_21
LBB0_10:
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_debug
LBB0_20:
	leaq	L_.str.9(%rip), %rdi
	jmp	LBB0_21
LBB0_3:
	leaq	L_.str.2(%rip), %rdi
LBB0_21:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pr_debug                       ## TAILCALL
LBB0_17:
	movq	_ATMEL_PDC_RNPR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r14), %edx
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_at91_mci_write
	movq	_ATMEL_PDC_RNCR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	testb	$3, 8(%r13)
	movl	4(%r14), %edx
	jne	LBB0_19
## %bb.18:
	leal	3(%rdx), %eax
	testl	%edx, %edx
	cmovnsl	%edx, %eax
	sarl	$2, %eax
	movl	%eax, %edx
LBB0_19:
	movq	%rbx, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_at91_mci_write
	jmp	LBB0_20
LBB0_12:
	leaq	L_.str.5(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_debug
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pre dma read\n"

L_.str.1:                               ## @.str.1
	.asciz	"no command\n"

L_.str.2:                               ## @.str.2
	.asciz	"no data\n"

L_.str.3:                               ## @.str.3
	.asciz	"Nothing left to transfer (index = %d)\n"

	.comm	_ATMEL_PDC_RCR,4,2              ## @ATMEL_PDC_RCR
L_.str.4:                               ## @.str.4
	.asciz	"Transfer active in current\n"

	.comm	_ATMEL_PDC_RNCR,4,2             ## @ATMEL_PDC_RNCR
L_.str.5:                               ## @.str.5
	.asciz	"Transfer active in next\n"

L_.str.6:                               ## @.str.6
	.asciz	"Using transfer index %d\n"

L_.str.7:                               ## @.str.7
	.asciz	"sg = %p\n"

	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
L_.str.8:                               ## @.str.8
	.asciz	"dma address = %08X, length = %d\n"

	.comm	_ATMEL_PDC_RPR,4,2              ## @ATMEL_PDC_RPR
	.comm	_ATMEL_PDC_RNPR,4,2             ## @ATMEL_PDC_RNPR
L_.str.9:                               ## @.str.9
	.asciz	"pre dma read done\n"

	.no_dead_strip	_at91_mci_pre_dma_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function at91_mci_pre_dma_read
_at91_mci_pre_dma_read:                 ; @at91_mci_pre_dma_read
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_debug
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_11
; %bb.1:
	ldr	x25, [x8]
	cbz	x25, LBB0_15
; %bb.2:
	ldr	x8, [x19]
	ldr	x9, [x25]
	cmp	x8, x9
	b.ge	LBB0_12
; %bb.3:
Lloh2:
	adrp	x27, _ATMEL_PDC_RCR@GOTPAGE
Lloh3:
	ldr	x27, [x27, _ATMEL_PDC_RCR@GOTPAGEOFF]
	mov	w28, #1
Lloh4:
	adrp	x22, l_.str.7@PAGE
Lloh5:
	add	x22, x22, l_.str.7@PAGEOFF
Lloh6:
	adrp	x20, _DMA_FROM_DEVICE@GOTPAGE
Lloh7:
	ldr	x20, [x20, _DMA_FROM_DEVICE@GOTPAGEOFF]
Lloh8:
	adrp	x26, _ATMEL_PDC_RPR@GOTPAGE
Lloh9:
	ldr	x26, [x26, _ATMEL_PDC_RPR@GOTPAGEOFF]
Lloh10:
	adrp	x23, l_.str.8@PAGE
Lloh11:
	add	x23, x23, l_.str.8@PAGEOFF
	b	LBB0_7
LBB0_4:                                 ;   in Loop: Header=BB0_7 Depth=1
	ldr	w1, [x27]
	mov	x0, x19
	bl	_at91_mci_read
	cbz	x0, LBB0_9
; %bb.5:                                ;   in Loop: Header=BB0_7 Depth=1
Lloh12:
	adrp	x0, l_.str.4@PAGE
Lloh13:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_pr_debug
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	mov	w28, #0
	ldr	x8, [x19]
	ldr	x9, [x25]
	cmp	x8, x9
	b.ge	LBB0_12
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	tbnz	w28, #0, LBB0_4
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
Lloh14:
	adrp	x8, _ATMEL_PDC_RNCR@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ATMEL_PDC_RNCR@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_at91_mci_read
	cbnz	x0, LBB0_18
LBB0_9:                                 ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [x19]
	str	x8, [sp]
Lloh17:
	adrp	x0, l_.str.6@PAGE
Lloh18:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_pr_debug
	ldr	x8, [x25, #16]
	ldr	x9, [x19]
	add	x10, x9, #1
	str	x10, [x19]
	mov	w10, #12
	madd	x21, x9, x10, x8
	str	x21, [sp]
	mov	x0, x22
	bl	_pr_debug
	mov	x0, x21
	bl	_sg_page
	mov	x1, x0
	ldr	w2, [x21, #8]
	mov	x24, x21
	ldr	w3, [x24, #4]!
	ldr	w4, [x20]
	mov	x0, #0
	bl	_dma_map_page
                                        ; kill: def $w0 killed $w0 def $x0
	str	w0, [x21]
	ldr	w8, [x24]
	stp	x0, x8, [sp]
	mov	x0, x23
	bl	_pr_debug
	tbz	w28, #0, LBB0_17
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	ldr	w1, [x26]
	ldr	w2, [x21]
	mov	x0, x19
	bl	_at91_mci_write
	ldr	w1, [x27]
	ldr	w8, [x25, #8]
	ldr	w9, [x24]
	add	w10, w9, #3
	cmp	w9, #0
	csel	w10, w10, w9, lt
	asr	w10, w10, #2
	tst	w8, #0x3
	csel	w2, w10, w9, eq
	mov	x0, x19
	bl	_at91_mci_write
	b	LBB0_6
LBB0_11:
Lloh19:
	adrp	x0, l_.str.1@PAGE
Lloh20:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_16
LBB0_12:
	str	x8, [sp]
Lloh21:
	adrp	x0, l_.str.3@PAGE
Lloh22:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_13:
	bl	_pr_debug
LBB0_14:
Lloh23:
	adrp	x0, l_.str.9@PAGE
Lloh24:
	add	x0, x0, l_.str.9@PAGEOFF
	b	LBB0_16
LBB0_15:
Lloh25:
	adrp	x0, l_.str.2@PAGE
Lloh26:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_16:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_pr_debug
LBB0_17:
Lloh27:
	adrp	x8, _ATMEL_PDC_RNPR@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ATMEL_PDC_RNPR@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	ldr	w2, [x21]
	mov	x0, x19
	bl	_at91_mci_write
Lloh30:
	adrp	x8, _ATMEL_PDC_RNCR@GOTPAGE
Lloh31:
	ldr	x8, [x8, _ATMEL_PDC_RNCR@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
	ldr	w8, [x25, #8]
	ldr	w9, [x24]
	add	w10, w9, #3
	cmp	w9, #0
	csel	w10, w10, w9, lt
	asr	w10, w10, #2
	tst	w8, #0x3
	csel	w2, w10, w9, eq
	mov	x0, x19
	bl	_at91_mci_write
	b	LBB0_14
LBB0_18:
Lloh33:
	adrp	x0, l_.str.5@PAGE
Lloh34:
	add	x0, x0, l_.str.5@PAGEOFF
	b	LBB0_13
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pre dma read\n"

l_.str.1:                               ; @.str.1
	.asciz	"no command\n"

l_.str.2:                               ; @.str.2
	.asciz	"no data\n"

l_.str.3:                               ; @.str.3
	.asciz	"Nothing left to transfer (index = %d)\n"

	.comm	_ATMEL_PDC_RCR,4,2              ; @ATMEL_PDC_RCR
l_.str.4:                               ; @.str.4
	.asciz	"Transfer active in current\n"

	.comm	_ATMEL_PDC_RNCR,4,2             ; @ATMEL_PDC_RNCR
l_.str.5:                               ; @.str.5
	.asciz	"Transfer active in next\n"

l_.str.6:                               ; @.str.6
	.asciz	"Using transfer index %d\n"

l_.str.7:                               ; @.str.7
	.asciz	"sg = %p\n"

	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
l_.str.8:                               ; @.str.8
	.asciz	"dma address = %08X, length = %d\n"

	.comm	_ATMEL_PDC_RPR,4,2              ; @ATMEL_PDC_RPR
	.comm	_ATMEL_PDC_RNPR,4,2             ; @ATMEL_PDC_RNPR
l_.str.9:                               ; @.str.9
	.asciz	"pre dma read done\n"

	.no_dead_strip	_at91_mci_pre_dma_read
.subsections_via_symbols
