	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function moxart_set_ios
_moxart_set_ios:                        ## @moxart_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	callq	_mmc_priv
	movq	%rax, %r12
	movq	%rax, %r14
	addq	$8, %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movl	(%r15), %esi
	testl	%esi, %esi
	je	LBB0_8
## %bb.1:
	movq	_CLK_DIV_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%r8d, %r8d
	testl	%eax, %eax
	cmovgl	%eax, %r8d
	movl	(%r12), %r9d
	movl	%r8d, %edi
	negl	%edi
	movl	$-1, %ebx
	movl	$2, %ecx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	leal	(%rdi,%rbx), %eax
	cmpl	$-1, %eax
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%r9d, %eax
	cltd
	idivl	%ecx
	incl	%ebx
	addl	$2, %ecx
	cmpl	%eax, %esi
	jl	LBB0_2
	jmp	LBB0_5
LBB0_3:
	movl	%r8d, %ebx
LBB0_5:
	movq	_CLK_SD@GOTPCREL(%rip), %rax
	movl	%ebx, %edi
	orl	(%rax), %edi
	leal	(%rbx,%rbx), %ecx
	addl	$2, %ecx
	movl	%r9d, %eax
	cltd
	idivl	%ecx
	movl	%eax, 4(%r12)
	xorl	%ecx, %ecx
	cmpl	%r9d, %eax
	jle	LBB0_7
## %bb.6:
	movq	_CLK_HISPD@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
LBB0_7:
	orl	%ecx, %edi
	movq	_REG_CLOCK_CONTROL@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%r12), %rsi
	callq	_writel
LBB0_8:
	movq	8(%r15), %rax
	movq	_MMC_POWER_OFF@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.9:
	movq	_REG_POWER_CONTROL@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	16(%r12), %rdi
	callq	_readl
	movq	_SD_POWER_ON@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	notl	%edi
	andl	%eax, %edi
	jmp	LBB0_11
LBB0_10:
	movq	16(%r15), %rax
	movq	_MIN_POWER@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	%eax, %edx
	subl	%ecx, %edx
	xorl	%edi, %edi
	cmpq	%rcx, %rax
	cmovgel	%edx, %edi
	movq	_SD_POWER_ON@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
LBB0_11:
	movq	_REG_POWER_CONTROL@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%r12), %rsi
	callq	_writel
	movl	24(%r15), %ecx
	cmpl	$128, %ecx
	jne	LBB0_12
## %bb.13:
	movq	_BUS_WIDTH_8@GOTPCREL(%rip), %rax
	cmpl	$129, %ecx
	je	LBB0_15
	jmp	LBB0_16
LBB0_12:
	movq	_BUS_WIDTH_1@GOTPCREL(%rip), %rax
	cmpl	$129, %ecx
	jne	LBB0_16
LBB0_15:
	movq	_BUS_WIDTH_4@GOTPCREL(%rip), %rax
LBB0_16:
	movl	(%rax), %edi
	movq	_REG_BUS_WIDTH@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%r12), %rsi
	callq	_writel
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock_irqrestore         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_CLK_DIV_MASK,4,2               ## @CLK_DIV_MASK
	.comm	_CLK_SD,4,2                     ## @CLK_SD
	.comm	_CLK_HISPD,4,2                  ## @CLK_HISPD
	.comm	_REG_CLOCK_CONTROL,8,3          ## @REG_CLOCK_CONTROL
	.comm	_MMC_POWER_OFF,8,3              ## @MMC_POWER_OFF
	.comm	_REG_POWER_CONTROL,8,3          ## @REG_POWER_CONTROL
	.comm	_SD_POWER_ON,4,2                ## @SD_POWER_ON
	.comm	_MIN_POWER,8,3                  ## @MIN_POWER
	.comm	_BUS_WIDTH_4,4,2                ## @BUS_WIDTH_4
	.comm	_REG_BUS_WIDTH,8,3              ## @REG_BUS_WIDTH
	.comm	_BUS_WIDTH_8,4,2                ## @BUS_WIDTH_8
	.comm	_BUS_WIDTH_1,4,2                ## @BUS_WIDTH_1
	.no_dead_strip	_moxart_set_ios
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function moxart_set_ios
_moxart_set_ios:                        ; @moxart_set_ios
	.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	x21, x1
	bl	_mmc_priv
	mov	x20, x0
	add	x19, x0, #8
	mov	x0, x19
	bl	_spin_lock_irqsave
	ldr	w10, [x21]
	cbz	w10, LBB0_6
; %bb.1:
	mov	w11, #0
Lloh0:
	adrp	x8, _CLK_DIV_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CLK_DIV_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, #0
	csel	w9, w8, wzr, gt
	ldr	w8, [x20]
	mov	w12, #2
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w9, w11
	b.eq	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	w11, w11, #1
	sdiv	w13, w8, w12
	add	w12, w12, #2
	cmp	w10, w13
	b.lt	LBB0_2
; %bb.4:
	sub	w9, w11, #1
LBB0_5:
Lloh3:
	adrp	x10, _CLK_SD@GOTPAGE
Lloh4:
	ldr	x10, [x10, _CLK_SD@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	orr	w10, w10, w9
	lsl	w9, w9, #1
	add	w9, w9, #2
	sdiv	w9, w8, w9
	str	w9, [x20, #4]
Lloh6:
	adrp	x11, _CLK_HISPD@GOTPAGE
Lloh7:
	ldr	x11, [x11, _CLK_HISPD@GOTPAGEOFF]
Lloh8:
	ldr	w11, [x11]
	cmp	w9, w8
	csel	w8, w11, wzr, gt
	orr	w0, w10, w8
	ldr	x8, [x20, #16]
Lloh9:
	adrp	x9, _REG_CLOCK_CONTROL@GOTPAGE
Lloh10:
	ldr	x9, [x9, _REG_CLOCK_CONTROL@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
LBB0_6:
	ldr	x8, [x21, #8]
Lloh12:
	adrp	x9, _MMC_POWER_OFF@GOTPAGE
Lloh13:
	ldr	x9, [x9, _MMC_POWER_OFF@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
Lloh15:
	adrp	x22, _REG_POWER_CONTROL@GOTPAGE
Lloh16:
	ldr	x22, [x22, _REG_POWER_CONTROL@GOTPAGEOFF]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.7:
	ldr	x8, [x20, #16]
	ldr	x9, [x22]
	add	x0, x9, x8
	bl	_readl
Lloh17:
	adrp	x8, _SD_POWER_ON@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SD_POWER_ON@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	bic	w0, w0, w8
	b	LBB0_9
LBB0_8:
	ldr	x8, [x21, #16]
Lloh20:
	adrp	x9, _MIN_POWER@GOTPAGE
Lloh21:
	ldr	x9, [x9, _MIN_POWER@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	sub	w10, w8, w9
	cmp	x8, x9
	csel	w8, wzr, w10, lt
Lloh23:
	adrp	x9, _SD_POWER_ON@GOTPAGE
Lloh24:
	ldr	x9, [x9, _SD_POWER_ON@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	orr	w0, w8, w9
LBB0_9:
	ldr	x8, [x20, #16]
	ldr	x9, [x22]
	add	x1, x9, x8
	bl	_writel
	ldr	w8, [x21, #24]
Lloh26:
	adrp	x9, _BUS_WIDTH_4@GOTPAGE
Lloh27:
	ldr	x9, [x9, _BUS_WIDTH_4@GOTPAGEOFF]
Lloh28:
	adrp	x10, _BUS_WIDTH_8@GOTPAGE
Lloh29:
	ldr	x10, [x10, _BUS_WIDTH_8@GOTPAGEOFF]
Lloh30:
	adrp	x11, _BUS_WIDTH_1@GOTPAGE
Lloh31:
	ldr	x11, [x11, _BUS_WIDTH_1@GOTPAGEOFF]
	cmp	w8, #128
	csel	x10, x10, x11, eq
	cmp	w8, #129
	csel	x8, x9, x10, eq
	ldr	w0, [x8]
	ldr	x8, [x20, #16]
Lloh32:
	adrp	x9, _REG_BUS_WIDTH@GOTPAGE
Lloh33:
	ldr	x9, [x9, _REG_BUS_WIDTH@GOTPAGEOFF]
Lloh34:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	mov	x0, x19
	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
	b	_spin_unlock_irqrestore
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_CLK_DIV_MASK,4,2               ; @CLK_DIV_MASK
	.comm	_CLK_SD,4,2                     ; @CLK_SD
	.comm	_CLK_HISPD,4,2                  ; @CLK_HISPD
	.comm	_REG_CLOCK_CONTROL,8,3          ; @REG_CLOCK_CONTROL
	.comm	_MMC_POWER_OFF,8,3              ; @MMC_POWER_OFF
	.comm	_REG_POWER_CONTROL,8,3          ; @REG_POWER_CONTROL
	.comm	_SD_POWER_ON,4,2                ; @SD_POWER_ON
	.comm	_MIN_POWER,8,3                  ; @MIN_POWER
	.comm	_BUS_WIDTH_4,4,2                ; @BUS_WIDTH_4
	.comm	_REG_BUS_WIDTH,8,3              ; @REG_BUS_WIDTH
	.comm	_BUS_WIDTH_8,4,2                ; @BUS_WIDTH_8
	.comm	_BUS_WIDTH_1,4,2                ; @BUS_WIDTH_1
	.no_dead_strip	_moxart_set_ios
.subsections_via_symbols
