	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function prepare_dma_single
_prepare_dma_single:                    ## @prepare_dma_single
	.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, %r13
	movq	%rdi, %r14
	movl	16(%rdi), %ebx
	movq	8(%rsi), %r15
	movl	16(%rsi), %r12d
	movq	%rsi, %rdi
	callq	_get_dma_dir
	movl	%ebx, %edi
	movq	%r15, %rsi
	movl	%r12d, %edx
	movl	%eax, %ecx
	callq	_dma_map_sg
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	_MMC_DATA_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%ebx, %ebx
	andl	(%r13), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	setne	%bl
	movq	_MIO_EMM_DMA_CFG_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$1, %esi
	callq	_FIELD_PREP
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_MIO_EMM_DMA_CFG_RW@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%ebx, %esi
	callq	_FIELD_PREP
	movl	%eax, %r12d
	movq	_MIO_EMM_DMA_CFG_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	8(%r13), %rdi
	callq	_sg_dma_len
                                        ## kill: def $eax killed $eax def $rax
	leal	7(%rax), %esi
	testl	%eax, %eax
	cmovnsl	%eax, %esi
	sarl	$3, %esi
	decl	%esi
	movl	%ebx, %edi
	callq	_FIELD_PREP
	movl	%eax, %r15d
	orl	-44(%rbp), %r15d                ## 4-byte Folded Reload
	orl	%r12d, %r15d
	movq	8(%r13), %rdi
	callq	_sg_dma_address
	movl	%eax, %r12d
	cmpq	$0, 8(%r14)
	jne	LBB0_4
## %bb.3:
	movq	_MIO_EMM_DMA_CFG_ADR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r12d, %esi
	callq	_FIELD_PREP
	orl	%eax, %r15d
LBB0_4:
	movq	(%r14), %rbx
	movq	%r14, %rdi
	callq	_MIO_EMM_DMA_CFG
	addq	%rax, %rbx
	movl	%r15d, %edi
	movq	%rbx, %rsi
	callq	_writeq
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	leaq	L_.str.2(%rip), %rax
	leaq	L_.str.1(%rip), %rbx
	cmoveq	%rax, %rbx
	movq	8(%r13), %rdi
	callq	_sg_dma_len
	leaq	L_.str(%rip), %rdi
	movq	%rbx, %rsi
	movl	%eax, %edx
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	callq	_pr_debug
	cmpq	$0, 8(%r14)
	je	LBB0_6
## %bb.5:
	movq	(%r14), %rbx
	movq	%r14, %rdi
	callq	_MIO_EMM_DMA_ADR
	addq	%rax, %rbx
	movl	%r12d, %edi
	movq	%rbx, %rsi
	callq	_writeq
	jmp	LBB0_6
LBB0_1:
	xorl	%r12d, %r12d
LBB0_6:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MMC_DATA_WRITE,4,2             ## @MMC_DATA_WRITE
	.comm	_MIO_EMM_DMA_CFG_EN,4,2         ## @MIO_EMM_DMA_CFG_EN
	.comm	_MIO_EMM_DMA_CFG_RW,4,2         ## @MIO_EMM_DMA_CFG_RW
	.comm	_MIO_EMM_DMA_CFG_SIZE,4,2       ## @MIO_EMM_DMA_CFG_SIZE
	.comm	_MIO_EMM_DMA_CFG_ADR,4,2        ## @MIO_EMM_DMA_CFG_ADR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[%s] sg_dma_len: %u  total sg_elem: %d\n"

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

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

	.comm	_MIO_EMM_DMA_CFG_ENDIAN,4,2     ## @MIO_EMM_DMA_CFG_ENDIAN
	.no_dead_strip	_prepare_dma_single
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function prepare_dma_single
_prepare_dma_single:                    ; @prepare_dma_single
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x1
	mov	x19, x0
	ldr	w21, [x0, #16]
	ldr	x22, [x1, #8]
	ldr	w23, [x1, #16]
	mov	x0, x1
	bl	_get_dma_dir
	mov	x3, x0
	mov	x0, x21
	mov	x1, x22
	mov	x2, x23
	bl	_dma_map_sg
	cbz	w0, LBB0_5
; %bb.1:
	mov	x21, x0
	ldr	w8, [x20]
Lloh0:
	adrp	x9, _MMC_DATA_WRITE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MMC_DATA_WRITE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	ands	w24, w9, w8
	cset	w22, ne
Lloh3:
	adrp	x8, _MIO_EMM_DMA_CFG_EN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MIO_EMM_DMA_CFG_EN@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	mov	w1, #1
	bl	_FIELD_PREP
	mov	x23, x0
Lloh6:
	adrp	x8, _MIO_EMM_DMA_CFG_RW@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MIO_EMM_DMA_CFG_RW@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	mov	x1, x22
	bl	_FIELD_PREP
	orr	w23, w0, w23
Lloh9:
	adrp	x8, _MIO_EMM_DMA_CFG_SIZE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MIO_EMM_DMA_CFG_SIZE@GOTPAGEOFF]
Lloh11:
	ldr	w22, [x8]
	ldr	x0, [x20, #8]
	bl	_sg_dma_len
	add	w8, w0, #7
	cmp	w0, #0
	csel	w8, w8, w0, lt
	asr	w8, w8, #3
	sub	w1, w8, #1
	mov	x0, x22
	bl	_FIELD_PREP
	orr	w23, w23, w0
	ldr	x0, [x20, #8]
	bl	_sg_dma_address
	mov	x22, x0
	ldr	x8, [x19, #8]
	cbnz	x8, LBB0_3
; %bb.2:
Lloh12:
	adrp	x8, _MIO_EMM_DMA_CFG_ADR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MIO_EMM_DMA_CFG_ADR@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	mov	x1, x22
	bl	_FIELD_PREP
	orr	w23, w0, w23
LBB0_3:
	ldr	x25, [x19]
	mov	x0, x19
	bl	_MIO_EMM_DMA_CFG
	add	x1, x0, x25
	mov	x0, x23
	bl	_writeq
Lloh15:
	adrp	x8, l_.str.1@PAGE
Lloh16:
	add	x8, x8, l_.str.1@PAGEOFF
Lloh17:
	adrp	x9, l_.str.2@PAGE
Lloh18:
	add	x9, x9, l_.str.2@PAGEOFF
	cmp	w24, #0
	csel	x23, x9, x8, eq
	ldr	x0, [x20, #8]
	bl	_sg_dma_len
	mov	x2, x0
Lloh19:
	adrp	x0, l_.str@PAGE
Lloh20:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x23
	mov	x3, x21
	bl	_pr_debug
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_6
; %bb.4:
	ldr	x20, [x19]
	mov	x0, x19
	bl	_MIO_EMM_DMA_ADR
	add	x1, x0, x20
	mov	x0, x22
	bl	_writeq
	b	LBB0_6
LBB0_5:
	mov	w22, #0
LBB0_6:
	mov	x0, x22
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_MMC_DATA_WRITE,4,2             ; @MMC_DATA_WRITE
	.comm	_MIO_EMM_DMA_CFG_EN,4,2         ; @MIO_EMM_DMA_CFG_EN
	.comm	_MIO_EMM_DMA_CFG_RW,4,2         ; @MIO_EMM_DMA_CFG_RW
	.comm	_MIO_EMM_DMA_CFG_SIZE,4,2       ; @MIO_EMM_DMA_CFG_SIZE
	.comm	_MIO_EMM_DMA_CFG_ADR,4,2        ; @MIO_EMM_DMA_CFG_ADR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[%s] sg_dma_len: %u  total sg_elem: %d\n"

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

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

	.comm	_MIO_EMM_DMA_CFG_ENDIAN,4,2     ; @MIO_EMM_DMA_CFG_ENDIAN
	.no_dead_strip	_prepare_dma_single
.subsections_via_symbols
