	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function prepare_ext_dma
_prepare_ext_dma:                       ## @prepare_ext_dma
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r12
	callq	_mmc_priv
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_MIO_EMM_DMA_VAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$1, %esi
	callq	_FIELD_PREP
	movl	%eax, %r13d
	movq	_MIO_EMM_DMA_SECTOR@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	(%r12), %rdi
	callq	_mmc_card_is_blockaddr
	xorl	%esi, %esi
	testq	%rax, %rax
	setne	%sil
	movl	%ebx, %edi
	callq	_FIELD_PREP
	movl	%eax, %ebx
	orl	%r13d, %ebx
	movq	_MIO_EMM_DMA_RW@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r14), %rax
	movq	_MMC_DATA_WRITE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	xorl	%esi, %esi
	andl	(%rax), %ecx
	setne	%sil
	callq	_FIELD_PREP
	movl	%eax, %r13d
	movq	_MIO_EMM_DMA_BLOCK_CNT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r14), %rax
	movl	4(%rax), %esi
	callq	_FIELD_PREP
	movl	%eax, %r15d
	orl	%ebx, %r15d
	movq	_MIO_EMM_DMA_CARD_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	8(%r14), %rax
	movl	(%rax), %esi
	callq	_FIELD_PREP
	orl	%r15d, %eax
	orl	%r13d, %eax
	movl	%eax, -44(%rbp)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %esi
	leaq	-44(%rbp), %rdi
	callq	_set_bus_id
	movq	(%r12), %rdi
	callq	_mmc_card_mmc
	testq	%rax, %rax
	je	LBB0_1
LBB0_3:
	movq	_MIO_EMM_DMA_MULTI@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$1, %esi
	callq	_FIELD_PREP
	orl	%eax, -44(%rbp)
LBB0_4:
	movl	-44(%rbp), %eax
	movq	_MIO_EMM_DMA_RW@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%eax, %ecx
	leaq	L_.str.2(%rip), %rcx
	leaq	L_.str.1(%rip), %rsi
	cmoveq	%rcx, %rsi
	movq	(%r14), %rcx
	movl	4(%rcx), %edx
	movq	_MIO_EMM_DMA_MULTI@GOTPCREL(%rip), %rdi
	xorl	%ecx, %ecx
	andl	(%rdi), %eax
	setne	%cl
	leaq	L_.str(%rip), %rdi
	callq	_pr_debug
	movl	-44(%rbp), %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	(%r12), %rdi
	callq	_mmc_card_sd
	testq	%rax, %rax
	je	LBB0_4
## %bb.2:
	movq	(%r12), %rax
	movq	_SD_SCR_CMD23_SUPPORT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	jne	LBB0_3
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_MIO_EMM_DMA_VAL,4,2            ## @MIO_EMM_DMA_VAL
	.comm	_MIO_EMM_DMA_SECTOR,4,2         ## @MIO_EMM_DMA_SECTOR
	.comm	_MIO_EMM_DMA_RW,4,2             ## @MIO_EMM_DMA_RW
	.comm	_MMC_DATA_WRITE,4,2             ## @MMC_DATA_WRITE
	.comm	_MIO_EMM_DMA_BLOCK_CNT,4,2      ## @MIO_EMM_DMA_BLOCK_CNT
	.comm	_MIO_EMM_DMA_CARD_ADDR,4,2      ## @MIO_EMM_DMA_CARD_ADDR
	.comm	_SD_SCR_CMD23_SUPPORT,4,2       ## @SD_SCR_CMD23_SUPPORT
	.comm	_MIO_EMM_DMA_MULTI,4,2          ## @MIO_EMM_DMA_MULTI
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[%s] blocks: %u  multi: %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"W"

L_.str.2:                               ## @.str.2
	.asciz	"R"

	.no_dead_strip	_prepare_ext_dma
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function prepare_ext_dma
_prepare_ext_dma:                       ; @prepare_ext_dma
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x1
	mov	x20, x0
	bl	_mmc_priv
	mov	x21, x0
Lloh0:
	adrp	x8, _MIO_EMM_DMA_VAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MIO_EMM_DMA_VAL@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	mov	w1, #1
	bl	_FIELD_PREP
	mov	x22, x0
Lloh3:
	adrp	x8, _MIO_EMM_DMA_SECTOR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MIO_EMM_DMA_SECTOR@GOTPAGEOFF]
Lloh5:
	ldr	w23, [x8]
	ldr	x0, [x20]
	bl	_mmc_card_is_blockaddr
	cmp	x0, #0
	cset	w1, ne
	mov	x0, x23
	bl	_FIELD_PREP
	orr	w23, w0, w22
Lloh6:
	adrp	x22, _MIO_EMM_DMA_RW@GOTPAGE
Lloh7:
	ldr	x22, [x22, _MIO_EMM_DMA_RW@GOTPAGEOFF]
	ldr	w0, [x22]
	ldr	x8, [x19]
	ldr	w8, [x8]
Lloh8:
	adrp	x9, _MMC_DATA_WRITE@GOTPAGE
Lloh9:
	ldr	x9, [x9, _MMC_DATA_WRITE@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w1, ne
	bl	_FIELD_PREP
	orr	w23, w23, w0
Lloh11:
	adrp	x8, _MIO_EMM_DMA_BLOCK_CNT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MIO_EMM_DMA_BLOCK_CNT@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	ldr	x8, [x19]
	ldr	w1, [x8, #4]
	bl	_FIELD_PREP
	orr	w23, w23, w0
Lloh14:
	adrp	x8, _MIO_EMM_DMA_CARD_ADDR@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MIO_EMM_DMA_CARD_ADDR@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	ldr	x8, [x19, #8]
	ldr	w1, [x8]
	bl	_FIELD_PREP
	orr	w8, w23, w0
	str	w8, [sp, #12]
	ldr	w1, [x21]
	add	x0, sp, #12
	bl	_set_bus_id
	ldr	x0, [x20]
	bl	_mmc_card_mmc
Lloh17:
	adrp	x21, _MIO_EMM_DMA_MULTI@GOTPAGE
Lloh18:
	ldr	x21, [x21, _MIO_EMM_DMA_MULTI@GOTPAGEOFF]
	cbz	x0, LBB0_3
LBB0_1:
	ldr	w0, [x21]
	mov	w1, #1
	bl	_FIELD_PREP
	ldr	w8, [sp, #12]
	orr	w8, w8, w0
	str	w8, [sp, #12]
LBB0_2:
	ldr	w8, [sp, #12]
	ldr	w9, [x22]
Lloh19:
	adrp	x10, l_.str.1@PAGE
Lloh20:
	add	x10, x10, l_.str.1@PAGEOFF
Lloh21:
	adrp	x11, l_.str.2@PAGE
Lloh22:
	add	x11, x11, l_.str.2@PAGEOFF
	tst	w9, w8
	csel	x1, x11, x10, eq
	ldr	x9, [x19]
	ldr	w2, [x9, #4]
	ldr	w9, [x21]
	tst	w9, w8
	cset	w3, ne
Lloh23:
	adrp	x0, l_.str@PAGE
Lloh24:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_debug
	ldr	w0, [sp, #12]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_3:
	ldr	x0, [x20]
	bl	_mmc_card_sd
	cbz	x0, LBB0_2
; %bb.4:
	ldr	x8, [x20]
	ldr	w8, [x8]
Lloh25:
	adrp	x9, _SD_SCR_CMD23_SUPPORT@GOTPAGE
Lloh26:
	ldr	x9, [x9, _SD_SCR_CMD23_SUPPORT@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_1
	b	LBB0_2
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_MIO_EMM_DMA_VAL,4,2            ; @MIO_EMM_DMA_VAL
	.comm	_MIO_EMM_DMA_SECTOR,4,2         ; @MIO_EMM_DMA_SECTOR
	.comm	_MIO_EMM_DMA_RW,4,2             ; @MIO_EMM_DMA_RW
	.comm	_MMC_DATA_WRITE,4,2             ; @MMC_DATA_WRITE
	.comm	_MIO_EMM_DMA_BLOCK_CNT,4,2      ; @MIO_EMM_DMA_BLOCK_CNT
	.comm	_MIO_EMM_DMA_CARD_ADDR,4,2      ; @MIO_EMM_DMA_CARD_ADDR
	.comm	_SD_SCR_CMD23_SUPPORT,4,2       ; @SD_SCR_CMD23_SUPPORT
	.comm	_MIO_EMM_DMA_MULTI,4,2          ; @MIO_EMM_DMA_MULTI
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[%s] blocks: %u  multi: %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"W"

l_.str.2:                               ; @.str.2
	.asciz	"R"

	.no_dead_strip	_prepare_ext_dma
.subsections_via_symbols
