	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function aml8726_mmc_update_ios
_aml8726_mmc_update_ios:                ## @aml8726_mmc_update_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	callq	_device_get_softc
	movq	%rax, %r14
	movq	_AML_MMC_CONFIG_WR_CRC_STAT_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	$2, %ebx
	movl	$2, %eax
	shll	%cl, %eax
	movq	_AML_MMC_CONFIG_WR_DELAY_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %ebx
	orl	%eax, %ebx
	movq	_AML_MMC_CONFIG_DMA_ENDIAN_SBW@GOTPCREL(%rip), %rdx
	movq	_AML_MMC_CONFIG_CMD_ARG_BITS_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	$39, %eax
	shll	%cl, %eax
	orl	(%rdx), %ebx
	movl	24(%r14), %ecx
	cmpl	$131, %ecx
	je	LBB0_1
## %bb.2:
	cmpl	$132, %ecx
	jne	LBB0_14
## %bb.3:
	movq	_AML_MMC_CONFIG_BUS_WIDTH_1@GOTPCREL(%rip), %rcx
	jmp	LBB0_4
LBB0_1:
	movq	_AML_MMC_CONFIG_BUS_WIDTH_4@GOTPCREL(%rip), %rcx
LBB0_4:
	orl	%eax, %ebx
	orl	(%rcx), %ebx
	movl	36(%r14), %esi
	movq	%r14, %rdi
	callq	_aml8726_mmc_div
	movq	_AML_MMC_CONFIG_CMD_CLK_DIV_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	orl	%eax, %ebx
	movq	_AML_MMC_CONFIG_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_CSR_WRITE_4
	movl	28(%r14), %eax
	cmpl	$130, %eax
	je	LBB0_13
## %bb.5:
	cmpl	$129, %eax
	je	LBB0_12
## %bb.6:
	cmpl	$128, %eax
	jne	LBB0_14
## %bb.7:
	movq	16(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_8
## %bb.9:
	movl	32(%r14), %ecx
	movl	$1, %eax
	shll	%cl, %eax
	movq	(%r14), %rsi
	movl	(%rsi), %ebx
	xorl	%edx, %edx
	btl	%ecx, %ebx
	jb	LBB0_11
## %bb.10:
	movl	$1, %edx
	testl	%eax, 4(%rsi)
	je	LBB0_14
LBB0_11:
	movl	8(%r14), %esi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_GPIO_PIN_SET                   ## TAILCALL
LBB0_14:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_15:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_13:
	movq	%r14, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_aml8726_mmc_power_off          ## TAILCALL
LBB0_12:
	movq	%r14, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_aml8726_mmc_power_on           ## TAILCALL
LBB0_8:
	xorl	%eax, %eax
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_AML_MMC_CONFIG_WR_CRC_STAT_SHIFT,4,2 ## @AML_MMC_CONFIG_WR_CRC_STAT_SHIFT
	.comm	_AML_MMC_CONFIG_WR_DELAY_SHIFT,4,2 ## @AML_MMC_CONFIG_WR_DELAY_SHIFT
	.comm	_AML_MMC_CONFIG_DMA_ENDIAN_SBW,4,2 ## @AML_MMC_CONFIG_DMA_ENDIAN_SBW
	.comm	_AML_MMC_CONFIG_CMD_ARG_BITS_SHIFT,4,2 ## @AML_MMC_CONFIG_CMD_ARG_BITS_SHIFT
	.comm	_AML_MMC_CONFIG_BUS_WIDTH_4,4,2 ## @AML_MMC_CONFIG_BUS_WIDTH_4
	.comm	_AML_MMC_CONFIG_BUS_WIDTH_1,4,2 ## @AML_MMC_CONFIG_BUS_WIDTH_1
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_AML_MMC_CONFIG_CMD_CLK_DIV_SHIFT,4,2 ## @AML_MMC_CONFIG_CMD_CLK_DIV_SHIFT
	.comm	_AML_MMC_CONFIG_REG,4,2         ## @AML_MMC_CONFIG_REG
	.no_dead_strip	_aml8726_mmc_update_ios
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function aml8726_mmc_update_ios
_aml8726_mmc_update_ios:                ; @aml8726_mmc_update_ios
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	bl	_device_get_softc
	mov	x19, x0
Lloh0:
	adrp	x8, _AML_MMC_CONFIG_WR_CRC_STAT_SHIFT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AML_MMC_CONFIG_WR_CRC_STAT_SHIFT@GOTPAGEOFF]
Lloh2:
	ldr	w11, [x8]
Lloh3:
	adrp	x8, _AML_MMC_CONFIG_WR_DELAY_SHIFT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AML_MMC_CONFIG_WR_DELAY_SHIFT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x8]
Lloh6:
	adrp	x8, _AML_MMC_CONFIG_DMA_ENDIAN_SBW@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AML_MMC_CONFIG_DMA_ENDIAN_SBW@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x8]
Lloh9:
	adrp	x8, _AML_MMC_CONFIG_CMD_ARG_BITS_SHIFT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _AML_MMC_CONFIG_CMD_ARG_BITS_SHIFT@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	ldr	w12, [x0, #24]
	cmp	w12, #131
	b.eq	LBB0_3
; %bb.1:
	cmp	w12, #132
	b.ne	LBB0_15
; %bb.2:
Lloh12:
	adrp	x12, _AML_MMC_CONFIG_BUS_WIDTH_1@GOTPAGE
Lloh13:
	ldr	x12, [x12, _AML_MMC_CONFIG_BUS_WIDTH_1@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh14:
	adrp	x12, _AML_MMC_CONFIG_BUS_WIDTH_4@GOTPAGE
Lloh15:
	ldr	x12, [x12, _AML_MMC_CONFIG_BUS_WIDTH_4@GOTPAGEOFF]
LBB0_4:
	mov	w13, #2
	lsl	w11, w13, w11
	lsl	w9, w13, w9
	orr	w9, w9, w11
	orr	w9, w9, w10
	mov	w10, #39
	lsl	w8, w10, w8
	orr	w8, w9, w8
	ldr	w9, [x12]
	orr	w20, w8, w9
	ldr	w1, [x19, #36]
	mov	x0, x19
	bl	_aml8726_mmc_div
Lloh16:
	adrp	x8, _AML_MMC_CONFIG_CMD_CLK_DIV_SHIFT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _AML_MMC_CONFIG_CMD_CLK_DIV_SHIFT@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	lsl	w8, w0, w8
	orr	w2, w20, w8
Lloh19:
	adrp	x8, _AML_MMC_CONFIG_REG@GOTPAGE
Lloh20:
	ldr	x8, [x8, _AML_MMC_CONFIG_REG@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_CSR_WRITE_4
	ldr	w8, [x19, #28]
	cmp	w8, #130
	b.eq	LBB0_10
; %bb.5:
	cmp	w8, #129
	b.eq	LBB0_11
; %bb.6:
	cmp	w8, #128
	b.ne	LBB0_15
; %bb.7:
	ldr	x0, [x19, #16]
	cbz	x0, LBB0_16
; %bb.8:
	ldr	x8, [x19]
	ldr	w9, [x19, #32]
	mov	w10, #1
	lsl	w9, w10, w9
	ldr	w10, [x8]
	tst	w9, w10
	b.eq	LBB0_12
; %bb.9:
	mov	w2, #0
	b	LBB0_14
LBB0_10:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_aml8726_mmc_power_off
LBB0_11:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_aml8726_mmc_power_on
LBB0_12:
	ldr	w8, [x8, #4]
	tst	w9, w8
	b.eq	LBB0_15
; %bb.13:
	mov	w2, #1
LBB0_14:
	ldr	w1, [x19, #8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_GPIO_PIN_SET
LBB0_15:
Lloh22:
	adrp	x8, _EINVAL@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
LBB0_16:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 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 AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_AML_MMC_CONFIG_WR_CRC_STAT_SHIFT,4,2 ; @AML_MMC_CONFIG_WR_CRC_STAT_SHIFT
	.comm	_AML_MMC_CONFIG_WR_DELAY_SHIFT,4,2 ; @AML_MMC_CONFIG_WR_DELAY_SHIFT
	.comm	_AML_MMC_CONFIG_DMA_ENDIAN_SBW,4,2 ; @AML_MMC_CONFIG_DMA_ENDIAN_SBW
	.comm	_AML_MMC_CONFIG_CMD_ARG_BITS_SHIFT,4,2 ; @AML_MMC_CONFIG_CMD_ARG_BITS_SHIFT
	.comm	_AML_MMC_CONFIG_BUS_WIDTH_4,4,2 ; @AML_MMC_CONFIG_BUS_WIDTH_4
	.comm	_AML_MMC_CONFIG_BUS_WIDTH_1,4,2 ; @AML_MMC_CONFIG_BUS_WIDTH_1
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_AML_MMC_CONFIG_CMD_CLK_DIV_SHIFT,4,2 ; @AML_MMC_CONFIG_CMD_CLK_DIV_SHIFT
	.comm	_AML_MMC_CONFIG_REG,4,2         ; @AML_MMC_CONFIG_REG
	.no_dead_strip	_aml8726_mmc_update_ios
.subsections_via_symbols
