	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function jz4740_mmc_prepare_dma_data
_jz4740_mmc_prepare_dma_data:           ## @jz4740_mmc_prepare_dma_data
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movq	%rsi, %rbx
	movq	%rdi, %r15
	callq	_jz4740_mmc_get_dma_chan
	movq	%rax, %r12
	movq	%rbx, %rdi
	callq	_mmc_get_dma_dir
	movl	(%rbx), %ecx
	movq	_COOKIE_PREMAPPED@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jne	LBB0_2
## %bb.1:
	movl	4(%rbx), %eax
	jmp	LBB0_5
LBB0_2:
	movq	(%r12), %rcx
	movl	(%rcx), %edi
	movl	8(%rbx), %edx
	movl	12(%rbx), %esi
	movl	%eax, %ecx
	callq	_dma_map_sg
	testl	%eax, %eax
	jle	LBB0_3
## %bb.4:
	movl	%eax, 4(%rbx)
	movl	%r14d, (%rbx)
	jmp	LBB0_5
LBB0_3:
	movl	(%r15), %edi
	callq	_mmc_dev
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_5:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_COOKIE_PREMAPPED,4,2           ## @COOKIE_PREMAPPED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to map scatterlist for DMA operation\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_jz4740_mmc_prepare_dma_data
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function jz4740_mmc_prepare_dma_data
_jz4740_mmc_prepare_dma_data:           ; @jz4740_mmc_prepare_dma_data
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x2
	mov	x19, x1
	mov	x21, x0
	bl	_jz4740_mmc_get_dma_chan
	mov	x22, x0
	mov	x0, x19
	bl	_mmc_get_dma_dir
	ldr	w8, [x19]
Lloh0:
	adrp	x9, _COOKIE_PREMAPPED@GOTPAGE
Lloh1:
	ldr	x9, [x9, _COOKIE_PREMAPPED@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_2
; %bb.1:
	ldr	w0, [x19, #4]
	b	LBB0_5
LBB0_2:
	mov	x3, x0
	ldr	x8, [x22]
	ldr	w0, [x8]
	ldp	w2, w1, [x19, #8]
	bl	_dma_map_sg
	cmp	w0, #0
	b.le	LBB0_4
; %bb.3:
	stp	w20, w0, [x19]
	b	LBB0_5
LBB0_4:
	ldr	w0, [x21]
	bl	_mmc_dev
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_COOKIE_PREMAPPED,4,2           ; @COOKIE_PREMAPPED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to map scatterlist for DMA operation\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_jz4740_mmc_prepare_dma_data
.subsections_via_symbols
