	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function msmsdcc_config_dma
_msmsdcc_config_dma:                    ## @msmsdcc_config_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r12
	movq	8(%rsi), %r13
	callq	_validate_dma
	testl	%eax, %eax
	jne	LBB0_18
## %bb.1:
	movq	8(%rbx), %rax
	movq	%rax, 32(%r12)
	movl	(%rbx), %eax
	movl	%eax, 8(%r12)
	movl	(%r12), %eax
	decl	%eax
	cmpl	$4, %eax
	jae	LBB0_2
## %bb.4:
	cltq
	leaq	l_switch.table.msmsdcc_config_dma(%rip), %rcx
	movq	(%rcx,%rax,8), %rax
	movq	_MMC_DATA_READ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	4(%rbx), %ecx
	jne	LBB0_5
## %bb.6:
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rcx
	jmp	LBB0_7
LBB0_2:
	movq	$0, 32(%r12)
	movl	$0, 8(%r12)
	movq	_ENOENT@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_5:
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rcx
LBB0_7:
	movq	48(%r12), %r14
	movl	(%rax), %r15d
	movl	(%rcx), %eax
	movl	%eax, 40(%r12)
	movq	$0, 64(%r12)
	movl	56(%r12), %edi
	callq	_mmc_dev
	movq	32(%r12), %rsi
	movl	8(%r12), %edx
	movl	40(%r12), %ecx
	movl	%eax, %edi
	callq	_dma_map_sg
	cmpl	8(%r12), %eax
	jne	LBB0_8
## %bb.9:
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	testl	%eax, %eax
	je	LBB0_17
## %bb.10:
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	8(%rcx), %r14
	xorl	%r15d, %r15d
	movq	_MCI_FIFOSIZE@GOTPCREL(%rip), %rbx
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_11 Depth=1
	movq	%r13, %rdi
	callq	_sg_dma_address
	movq	%rax, 24(%r14)
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	callq	_msmsdcc_fifo_addr
	movq	%rax, 16(%r14)
	movq	_MCI_FIFOSIZE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %eax
	movl	%eax, %ecx
	shll	$16, %ecx
	orl	%eax, %ecx
	movl	%ecx, (%r14)
	movl	(%rdx), %eax
	shll	$16, %eax
	movl	%eax, 4(%r14)
	movl	%ebx, %eax
	shll	$16, %eax
	addl	%ebx, %eax
	movl	%eax, 8(%r14)
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_CMD_DST_CRCI
	movq	_MCI_FIFOSIZE@GOTPCREL(%rip), %rbx
LBB0_16:                                ##   in Loop: Header=BB0_11 Depth=1
	orl	%eax, 12(%r14)
	addq	$32, %r14
	addq	$4, %r13
	incl	%r15d
	movl	8(%r12), %eax
	cmpl	%eax, %r15d
	jae	LBB0_17
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	_CMD_MODE_BOX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 12(%r14)
	decl	%eax
	cmpl	%eax, %r15d
	jne	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	_CMD_LC@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movl	%ecx, 12(%r14)
LBB0_13:                                ##   in Loop: Header=BB0_11 Depth=1
	movq	%r13, %rdi
	callq	_sg_dma_len
	cltd
	idivl	(%rbx)
	movl	%edx, %r12d
	movq	%r13, %rdi
	callq	_sg_dma_len
	cltd
	idivl	(%rbx)
	movq	%rbx, %rdx
	movl	%eax, %ebx
	cmpl	$1, %r12d
	sbbl	$-1, %ebx
	movq	_MMC_DATA_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	testl	%eax, 4(%rcx)
	je	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%rdx, %r12
	callq	_msmsdcc_fifo_addr
	movq	%rax, 24(%r14)
	movq	%r13, %rdi
	callq	_sg_dma_address
	movq	%rax, 16(%r14)
	movl	(%r12), %eax
	movl	%eax, %ecx
	shll	$16, %ecx
	orl	%eax, %ecx
	movl	%ecx, (%r14)
	movl	(%r12), %eax
	movl	%eax, 4(%r14)
	movl	%ebx, %eax
	shll	$16, %eax
	addl	%ebx, %eax
	movl	%eax, 8(%r14)
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_CMD_SRC_CRCI
	movq	%r12, %rbx
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_16
LBB0_8:
	movl	56(%r12), %edi
	callq	_mmc_hostname
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_pr_err
	movq	$0, 32(%r12)
	movl	$0, 8(%r12)
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
LBB0_3:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_18
LBB0_17:
	movl	12(%r12), %edi
	andl	$7, %edi
	callq	_BUG_ON
	movl	12(%r12), %eax
	sarl	$3, %eax
	movq	_CMD_PTR_LP@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	movq	_DMOV_CMD_PTR_LIST@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	24(%r12), %edi
	callq	_DMOV_CMD_ADDR
	orl	%ebx, %eax
	movl	%eax, 16(%r12)
	movq	_msmsdcc_dma_complete_func@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%r12)
	xorl	%eax, %eax
LBB0_18:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MSMSDCC_CRCI_SDC1,4,2          ## @MSMSDCC_CRCI_SDC1
	.comm	_MSMSDCC_CRCI_SDC2,4,2          ## @MSMSDCC_CRCI_SDC2
	.comm	_MSMSDCC_CRCI_SDC3,4,2          ## @MSMSDCC_CRCI_SDC3
	.comm	_MSMSDCC_CRCI_SDC4,4,2          ## @MSMSDCC_CRCI_SDC4
	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_MMC_DATA_READ,4,2              ## @MMC_DATA_READ
	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: Unable to map in all sg elements\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_CMD_MODE_BOX,4,2               ## @CMD_MODE_BOX
	.comm	_CMD_LC,4,2                     ## @CMD_LC
	.comm	_MCI_FIFOSIZE,4,2               ## @MCI_FIFOSIZE
	.comm	_CMD_PTR_LP,4,2                 ## @CMD_PTR_LP
	.comm	_DMOV_CMD_PTR_LIST,4,2          ## @DMOV_CMD_PTR_LIST
	.comm	_msmsdcc_dma_complete_func,4,2  ## @msmsdcc_dma_complete_func
	.no_dead_strip	_msmsdcc_config_dma
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.msmsdcc_config_dma
l_switch.table.msmsdcc_config_dma:
	.quad	_MSMSDCC_CRCI_SDC1
	.quad	_MSMSDCC_CRCI_SDC2
	.quad	_MSMSDCC_CRCI_SDC3
	.quad	_MSMSDCC_CRCI_SDC4

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function msmsdcc_config_dma
_msmsdcc_config_dma:                    ; @msmsdcc_config_dma
	.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	x20, x1
	mov	x19, x0
	ldr	x21, [x1, #8]
	bl	_validate_dma
	cbnz	w0, LBB0_15
; %bb.1:
	ldr	x8, [x20, #8]
	str	x8, [x19, #32]
	ldr	w8, [x20]
	str	w8, [x19, #8]
	ldr	w8, [x19]
	sub	w8, w8, #1
	cmp	w8, #4
	b.hs	LBB0_11
; %bb.2:
Lloh0:
	adrp	x9, l_switch.table.msmsdcc_config_dma@PAGE
Lloh1:
	add	x9, x9, l_switch.table.msmsdcc_config_dma@PAGEOFF
	ldr	x23, [x19, #48]
	ldr	x8, [x9, w8, sxtw #3]
	ldr	w22, [x8]
Lloh2:
	adrp	x9, _MMC_DATA_READ@GOTPAGE
Lloh3:
	ldr	x9, [x9, _MMC_DATA_READ@GOTPAGEOFF]
	ldr	w8, [x20, #4]
Lloh4:
	ldr	w9, [x9]
Lloh5:
	adrp	x10, _DMA_TO_DEVICE@GOTPAGE
Lloh6:
	ldr	x10, [x10, _DMA_TO_DEVICE@GOTPAGEOFF]
Lloh7:
	adrp	x11, _DMA_FROM_DEVICE@GOTPAGE
Lloh8:
	ldr	x11, [x11, _DMA_FROM_DEVICE@GOTPAGEOFF]
	tst	w9, w8
	csel	x8, x10, x11, eq
	ldr	w8, [x8]
	str	w8, [x19, #40]
	str	xzr, [x19, #64]
	ldr	w0, [x19, #56]
	bl	_mmc_dev
	ldr	x1, [x19, #32]
	ldr	w2, [x19, #8]
	ldr	w3, [x19, #40]
	bl	_dma_map_sg
	ldr	w8, [x19, #8]
	cmp	w0, w8
	b.ne	LBB0_12
; %bb.3:
	str	x23, [sp, #8]                   ; 8-byte Folded Spill
	cbz	w0, LBB0_14
; %bb.4:
	mov	w25, #0
	mov	w26, #65537
	ldr	x8, [sp, #8]                    ; 8-byte Folded Reload
	ldr	x8, [x8, #8]
	add	x27, x8, #12
Lloh9:
	adrp	x28, _CMD_MODE_BOX@GOTPAGE
Lloh10:
	ldr	x28, [x28, _CMD_MODE_BOX@GOTPAGEOFF]
Lloh11:
	adrp	x23, _MCI_FIFOSIZE@GOTPAGE
Lloh12:
	ldr	x23, [x23, _MCI_FIFOSIZE@GOTPAGEOFF]
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x21
	bl	_sg_dma_address
	stur	x0, [x27, #12]
	mov	x0, x19
	bl	_msmsdcc_fifo_addr
	stur	x0, [x27, #4]
	ldr	w8, [x23]
	orr	w8, w8, w8, lsl #16
	stur	w8, [x27, #-12]
	ldr	w8, [x23]
	lsl	w8, w8, #16
	mul	w9, w24, w26
	stp	w8, w9, [x27, #-8]
	mov	x0, x22
	bl	_CMD_DST_CRCI
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	ldr	w8, [x27]
	orr	w8, w8, w0
	str	w8, [x27], #32
	add	x21, x21, #4
	add	w25, w25, #1
	ldr	w0, [x19, #8]
	cmp	w25, w0
	b.hs	LBB0_14
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x28]
	str	w8, [x27]
	sub	w9, w0, #1
	cmp	w25, w9
	b.ne	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
Lloh13:
	adrp	x9, _CMD_LC@GOTPAGE
Lloh14:
	ldr	x9, [x9, _CMD_LC@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x27]
LBB0_9:                                 ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x21
	bl	_sg_dma_len
	ldr	w8, [x23]
	sdiv	w9, w0, w8
	msub	w24, w9, w8, w0
	mov	x0, x21
	bl	_sg_dma_len
	cmp	w24, #0
	ldr	w8, [x23]
	sdiv	w8, w0, w8
	cinc	w24, w8, ne
	ldr	w8, [x20, #4]
Lloh16:
	adrp	x9, _MMC_DATA_READ@GOTPAGE
Lloh17:
	ldr	x9, [x9, _MMC_DATA_READ@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x19
	bl	_msmsdcc_fifo_addr
	stur	x0, [x27, #12]
	mov	x0, x21
	bl	_sg_dma_address
	stur	x0, [x27, #4]
	ldr	w8, [x23]
	orr	w8, w8, w8, lsl #16
	stur	w8, [x27, #-12]
	ldr	w8, [x23]
	mul	w9, w24, w26
	stp	w8, w9, [x27, #-8]
	mov	x0, x22
	bl	_CMD_SRC_CRCI
	b	LBB0_6
LBB0_11:
	str	xzr, [x19, #32]
	str	wzr, [x19, #8]
Lloh19:
	adrp	x8, _ENOENT@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
	b	LBB0_13
LBB0_12:
	ldr	w0, [x19, #56]
	bl	_mmc_hostname
	mov	x1, x0
Lloh21:
	adrp	x0, l_.str@PAGE
Lloh22:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
	str	xzr, [x19, #32]
	str	wzr, [x19, #8]
Lloh23:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_13:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_15
LBB0_14:
	ldr	w8, [x19, #12]
	and	w0, w8, #0x7
	bl	_BUG_ON
	ldr	w8, [x19, #12]
Lloh25:
	adrp	x9, _CMD_PTR_LP@GOTPAGE
Lloh26:
	ldr	x9, [x9, _CMD_PTR_LP@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	orr	w8, w9, w8, asr #3
	ldr	x9, [sp, #8]                    ; 8-byte Folded Reload
	str	w8, [x9]
Lloh28:
	adrp	x8, _DMOV_CMD_PTR_LIST@GOTPAGE
Lloh29:
	ldr	x8, [x8, _DMOV_CMD_PTR_LIST@GOTPAGEOFF]
Lloh30:
	ldr	w20, [x8]
	ldr	w0, [x19, #24]
	bl	_DMOV_CMD_ADDR
	mov	x8, x0
	mov	w0, #0
Lloh31:
	adrp	x9, _msmsdcc_dma_complete_func@GOTPAGE
Lloh32:
	ldr	x9, [x9, _msmsdcc_dma_complete_func@GOTPAGEOFF]
Lloh33:
	ldr	w9, [x9]
	orr	w8, w8, w20
	stp	w8, w9, [x19, #16]
LBB0_15:
	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
	ret
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_MSMSDCC_CRCI_SDC1,4,2          ; @MSMSDCC_CRCI_SDC1
	.comm	_MSMSDCC_CRCI_SDC2,4,2          ; @MSMSDCC_CRCI_SDC2
	.comm	_MSMSDCC_CRCI_SDC3,4,2          ; @MSMSDCC_CRCI_SDC3
	.comm	_MSMSDCC_CRCI_SDC4,4,2          ; @MSMSDCC_CRCI_SDC4
	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_MMC_DATA_READ,4,2              ; @MMC_DATA_READ
	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: Unable to map in all sg elements\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_CMD_MODE_BOX,4,2               ; @CMD_MODE_BOX
	.comm	_CMD_LC,4,2                     ; @CMD_LC
	.comm	_MCI_FIFOSIZE,4,2               ; @MCI_FIFOSIZE
	.comm	_CMD_PTR_LP,4,2                 ; @CMD_PTR_LP
	.comm	_DMOV_CMD_PTR_LIST,4,2          ; @DMOV_CMD_PTR_LIST
	.comm	_msmsdcc_dma_complete_func,4,2  ; @msmsdcc_dma_complete_func
	.no_dead_strip	_msmsdcc_config_dma
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.msmsdcc_config_dma
l_switch.table.msmsdcc_config_dma:
	.quad	_MSMSDCC_CRCI_SDC1
	.quad	_MSMSDCC_CRCI_SDC2
	.quad	_MSMSDCC_CRCI_SDC3
	.quad	_MSMSDCC_CRCI_SDC4

.subsections_via_symbols
