	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mxcmci_set_ios
_mxcmci_set_ios:                        ## @mxcmci_set_ios
	.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	%rsi, %r14
	movq	%rdi, %r15
	callq	_mmc_priv
	movq	%rax, %r13
	movq	(%r14), %rax
	movq	_MMC_BUS_WIDTH_4@GOTPCREL(%rip), %r12
	cmpq	(%r12), %rax
	movl	$16, %eax
	movl	$4, %ebx
	cmovel	%eax, %ebx
	movq	%r13, %rdi
	callq	_mxcmci_use_dma
	testq	%rax, %rax
	je	LBB0_4
## %bb.1:
	cmpl	(%r13), %ebx
	je	LBB0_4
## %bb.2:
	movl	%ebx, (%r13)
	movq	%r15, %rdi
	callq	_mxcmci_setup_dma
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	40(%r13), %edi
	callq	_mmc_dev
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	callq	_dev_err
	movq	24(%r13), %rdi
	callq	_dma_release_channel
	xorps	%xmm0, %xmm0
	movups	%xmm0, 24(%r13)
LBB0_4:
	movq	(%r14), %rcx
	movq	_CMD_DAT_CONT_BUS_WIDTH_4@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpq	(%r12), %rcx
	jne	LBB0_6
## %bb.5:
	orl	%eax, 20(%r13)
	jmp	LBB0_7
LBB0_6:
	notl	%eax
	andl	%eax, 20(%r13)
LBB0_7:
	movq	8(%r14), %rax
	cmpq	%rax, 8(%r13)
	je	LBB0_10
## %bb.8:
	movq	%rax, 8(%r13)
	movl	20(%r14), %esi
	movq	%r13, %rdi
	callq	_mxcmci_set_power
	movq	8(%r14), %rax
	movq	_MMC_POWER_ON@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.9:
	movq	_CMD_DAT_CONT_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 20(%r13)
LBB0_10:
	movl	16(%r14), %esi
	testl	%esi, %esi
	je	LBB0_11
## %bb.12:
	movq	%r13, %rdi
	callq	_mxcmci_set_clk_rate
	movq	_STR_STP_CLK_START_CLK@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_11:
	movq	_STR_STP_CLK_STOP_CLK@GOTPCREL(%rip), %rax
LBB0_13:
	movl	(%rax), %esi
	movq	_MMC_REG_STR_STP_CLK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	callq	_mxcmci_writew
	movl	16(%r14), %eax
	movl	%eax, 16(%r13)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MMC_BUS_WIDTH_4,8,3            ## @MMC_BUS_WIDTH_4
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to config DMA channel. Falling back to PIO\n"

	.comm	_CMD_DAT_CONT_BUS_WIDTH_4,4,2   ## @CMD_DAT_CONT_BUS_WIDTH_4
	.comm	_MMC_POWER_ON,8,3               ## @MMC_POWER_ON
	.comm	_CMD_DAT_CONT_INIT,4,2          ## @CMD_DAT_CONT_INIT
	.comm	_STR_STP_CLK_START_CLK,4,2      ## @STR_STP_CLK_START_CLK
	.comm	_MMC_REG_STR_STP_CLK,4,2        ## @MMC_REG_STR_STP_CLK
	.comm	_STR_STP_CLK_STOP_CLK,4,2       ## @STR_STP_CLK_STOP_CLK
	.no_dead_strip	_mxcmci_set_ios
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mxcmci_set_ios
_mxcmci_set_ios:                        ; @mxcmci_set_ios
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x21, x0
	bl	_mmc_priv
	mov	x20, x0
Lloh0:
	adrp	x22, _MMC_BUS_WIDTH_4@GOTPAGE
Lloh1:
	ldr	x22, [x22, _MMC_BUS_WIDTH_4@GOTPAGEOFF]
	ldr	x8, [x19]
	ldr	x9, [x22]
	cmp	x8, x9
	mov	w8, #4
	mov	w9, #16
	csel	w23, w9, w8, eq
	bl	_mxcmci_use_dma
	cbz	x0, LBB0_4
; %bb.1:
	ldr	w8, [x20]
	cmp	w23, w8
	b.eq	LBB0_4
; %bb.2:
	str	w23, [x20]
	mov	x0, x21
	bl	_mxcmci_setup_dma
	cbz	w0, LBB0_4
; %bb.3:
	ldr	w0, [x20, #40]
	bl	_mmc_dev
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	ldr	x0, [x20, #24]
	bl	_dma_release_channel
	stp	xzr, xzr, [x20, #24]
LBB0_4:
	ldr	x9, [x19]
	ldr	x10, [x22]
Lloh4:
	adrp	x8, _CMD_DAT_CONT_BUS_WIDTH_4@GOTPAGE
Lloh5:
	ldr	x8, [x8, _CMD_DAT_CONT_BUS_WIDTH_4@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	cmp	x9, x10
	b.ne	LBB0_6
; %bb.5:
	ldr	w9, [x20, #20]
	orr	w8, w9, w8
	b	LBB0_7
LBB0_6:
	ldr	w9, [x20, #20]
	bic	w8, w9, w8
LBB0_7:
	str	w8, [x20, #20]
	ldr	x9, [x20, #8]
	ldr	x8, [x19, #8]
	cmp	x9, x8
	b.eq	LBB0_10
; %bb.8:
	str	x8, [x20, #8]
	ldr	w1, [x19, #20]
	mov	x0, x20
	bl	_mxcmci_set_power
	ldr	x8, [x19, #8]
Lloh7:
	adrp	x9, _MMC_POWER_ON@GOTPAGE
Lloh8:
	ldr	x9, [x9, _MMC_POWER_ON@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.9:
Lloh10:
	adrp	x8, _CMD_DAT_CONT_INIT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _CMD_DAT_CONT_INIT@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	ldr	w9, [x20, #20]
	orr	w8, w9, w8
	str	w8, [x20, #20]
LBB0_10:
	ldr	w1, [x19, #16]
	cbz	w1, LBB0_12
; %bb.11:
	mov	x0, x20
	bl	_mxcmci_set_clk_rate
Lloh13:
	adrp	x8, _STR_STP_CLK_START_CLK@GOTPAGE
Lloh14:
	ldr	x8, [x8, _STR_STP_CLK_START_CLK@GOTPAGEOFF]
	b	LBB0_13
LBB0_12:
Lloh15:
	adrp	x8, _STR_STP_CLK_STOP_CLK@GOTPAGE
Lloh16:
	ldr	x8, [x8, _STR_STP_CLK_STOP_CLK@GOTPAGEOFF]
LBB0_13:
	ldr	w1, [x8]
Lloh17:
	adrp	x8, _MMC_REG_STR_STP_CLK@GOTPAGE
Lloh18:
	ldr	x8, [x8, _MMC_REG_STR_STP_CLK@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_mxcmci_writew
	ldr	w8, [x19, #16]
	str	w8, [x20, #16]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_MMC_BUS_WIDTH_4,8,3            ; @MMC_BUS_WIDTH_4
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to config DMA channel. Falling back to PIO\n"

	.comm	_CMD_DAT_CONT_BUS_WIDTH_4,4,2   ; @CMD_DAT_CONT_BUS_WIDTH_4
	.comm	_MMC_POWER_ON,8,3               ; @MMC_POWER_ON
	.comm	_CMD_DAT_CONT_INIT,4,2          ; @CMD_DAT_CONT_INIT
	.comm	_STR_STP_CLK_START_CLK,4,2      ; @STR_STP_CLK_START_CLK
	.comm	_MMC_REG_STR_STP_CLK,4,2        ; @MMC_REG_STR_STP_CLK
	.comm	_STR_STP_CLK_STOP_CLK,4,2       ; @STR_STP_CLK_STOP_CLK
	.no_dead_strip	_mxcmci_set_ios
.subsections_via_symbols
