	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function aml8726_mmc_start_command
_aml8726_mmc_start_command:             ## @aml8726_mmc_start_command
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_MMC_ERR_INVALID@GOTPCREL(%rip), %rbx
	cmpl	$63, (%rsi)
	jg	LBB0_27
## %bb.1:
	movq	%rsi, %r14
	movq	%rdi, %r12
	movl	$1, %esi
	callq	_aml8726_mmc_soft_reset
	movq	_AML_MMC_CMD_START_BIT@GOTPCREL(%rip), %rax
	movq	_AML_MMC_CMD_TRANS_BIT_HOST@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	orl	(%r14), %edx
	movq	$0, -72(%rbp)
	movq	_AML_MMC_CMD_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	16(%r14), %rcx
	cmpq	%r14, (%rcx)
	jne	LBB0_3
## %bb.2:
	movl	4(%r12), %ecx
	testl	%ecx, %ecx
	cmovnel	%ecx, %eax
LBB0_3:
	movl	(%r12), %r8d
	movl	$0, 4(%r12)
	movl	4(%r14), %esi
	movq	_MMC_RSP_136@GOTPCREL(%rip), %rcx
	testl	%esi, (%rcx)
	je	LBB0_5
## %bb.4:
	movq	_AML_MMC_CMD_RESP_CRC7_FROM_8@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edx
	movq	_AML_MMC_CMD_RESP_BITS_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	$133, %edi
	jmp	LBB0_7
LBB0_5:
	movq	_MMC_RSP_PRESENT@GOTPCREL(%rip), %rcx
	testl	%esi, (%rcx)
	je	LBB0_8
## %bb.6:
	movq	_AML_MMC_CMD_RESP_BITS_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	$45, %edi
LBB0_7:
	shll	%cl, %edi
	orl	%edi, %edx
LBB0_8:
	movq	_MMC_RSP_CRC@GOTPCREL(%rip), %rcx
	movl	$0, %r15d
	testl	%esi, (%rcx)
	jne	LBB0_10
## %bb.9:
	movq	_AML_MMC_CMD_RESP_NO_CRC7@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r15d
LBB0_10:
	orl	%edx, %r15d
	movq	_MMC_RSP_BUSY@GOTPCREL(%rip), %rcx
	andl	(%rcx), %esi
	je	LBB0_12
## %bb.11:
	movq	_AML_MMC_CMD_CHECK_DAT0_BUSY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
LBB0_12:
	orl	%esi, %r15d
	movq	24(%r14), %r13
	testq	%r13, %r13
	je	LBB0_13
## %bb.14:
	movl	(%r13), %r10d
	testl	%r10d, %r10d
	je	LBB0_13
## %bb.15:
	movl	4(%r13), %esi
	movq	_MMC_DATA_READ@GOTPCREL(%rip), %rdx
	movq	_MMC_DATA_WRITE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rdx), %ecx
	testl	%esi, %ecx
	je	LBB0_13
## %bb.16:
	movq	_MMC_DATA_MULTI@GOTPCREL(%rip), %rax
	movl	%r10d, %r9d
	testl	%esi, (%rax)
	je	LBB0_18
## %bb.17:
	movq	_MMC_SECTOR_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movl	%r10d, %eax
	cltd
	idivl	%r9d
	testl	%edx, %edx
	jne	LBB0_27
LBB0_18:
	movq	32(%r12), %rax
	movq	_bus_width_4@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	xorl	%edx, %edx
	cmpq	%rcx, %rax
	setne	%dl
	leal	(%rdx,%rdx,2), %edx
	leal	(,%r9,8), %edi
	orl	%edx, %edi
	leal	16(%rdi), %edx
	addl	$64, %edi
	cmpq	%rcx, %rax
	movq	_AML_MMC_CMD_REP_PKG_CNT_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	cmovnel	%edx, %edi
	movl	%r10d, %eax
	cltd
	idivl	%r9d
	decl	%eax
	shll	%cl, %eax
	movq	_MMC_DATA_STREAM@GOTPCREL(%rip), %rcx
	andl	(%rcx), %esi
	je	LBB0_20
## %bb.19:
	movq	_AML_MMC_MULT_CONFIG_STREAM_EN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
LBB0_20:
	addl	$-4, %edi
	cmpl	$16383, %edi                    ## imm = 0x3FFF
	jg	LBB0_27
## %bb.21:
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movq	%r9, -80(%rbp)                  ## 8-byte Spill
	movl	%r8d, -64(%rbp)                 ## 4-byte Spill
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	_AML_MMC_EXTENSION_PKT_SIZE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %edi
	movl	24(%r12), %esi
	movq	%rdi, %rbx
	movl	28(%r12), %edi
	movl	8(%r13), %edx
	movq	_aml8726_mmc_mapmem@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_BUS_DMA_NOWAIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rsp)
	leaq	-72(%rbp), %r9
	movl	%r10d, %ecx
	callq	_bus_dmamap_load
	testl	%eax, %eax
	je	LBB0_23
## %bb.22:
	movq	_MMC_ERR_NO_MEMORY@GOTPCREL(%rip), %rbx
	jmp	LBB0_27
LBB0_13:
	xorl	%ecx, %ecx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movl	%r8d, %ebx
LBB0_26:
	movq	%r14, 16(%r12)
	movq	_MMC_ERR_NONE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 8(%r14)
	movq	_AML_MMC_MAX_TIMEOUT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	cmpl	%edi, %eax
	cmovll	%eax, %edi
	leaq	8(%r12), %r13
	callq	_MSECS_TO_TICKS
	movq	_aml8726_mmc_timeout@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%r13, %rdi
	movl	%eax, %esi
	movq	%r12, %rcx
	callq	_callout_reset
	movq	_AML_MMC_CMD_ARGUMENT_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	12(%r14), %edx
	movq	%r12, %rdi
	callq	_CSR_WRITE_4
	movq	_AML_MMC_MULT_CONFIG_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	%ebx, %edx
	callq	_CSR_WRITE_4
	movq	_AML_MMC_EXTENSION_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_CSR_WRITE_4
	movq	_AML_MMC_DMA_ADDR_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	-72(%rbp), %edx
	movq	%r12, %rdi
	callq	_CSR_WRITE_4
	movq	_AML_MMC_CMD_SEND_REG@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r12, %rdi
	movl	%r15d, %edx
	callq	_CSR_WRITE_4
	movl	(%rbx), %esi
	movq	_MMC_ERR_NONE@GOTPCREL(%rip), %rbx
	movq	%r12, %rdi
	callq	_CSR_BARRIER
LBB0_27:
	movl	(%rbx), %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_23:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	orl	-60(%rbp), %r15d                ## 4-byte Folded Reload
	movl	-64(%rbp), %eax                 ## 4-byte Reload
	orl	%eax, -44(%rbp)                 ## 4-byte Folded Spill
	movq	_MMC_DATA_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	4(%r13), %eax
	movq	_AML_MMC_CMD_RESP_HAS_DATA@GOTPCREL(%rip), %rax
	cmoveq	_AML_MMC_CMD_CMD_HAS_DATA@GOTPCREL(%rip), %rax
	movl	24(%r12), %esi
	movq	_BUS_DMASYNC_PREREAD@GOTPCREL(%rip), %rcx
	cmoveq	_BUS_DMASYNC_PREWRITE@GOTPCREL(%rip), %rcx
	movq	_AML_MMC_READ_TIMEOUT@GOTPCREL(%rip), %rbx
	cmoveq	_AML_MMC_WRITE_TIMEOUT@GOTPCREL(%rip), %rbx
	movl	28(%r12), %edi
	movl	(%rcx), %edx
	orl	(%rax), %r15d
	callq	_bus_dmamap_sync
	movl	(%r13), %eax
	cltd
	idivl	-80(%rbp)                       ## 4-byte Folded Reload
	imull	(%rbx), %eax
	movq	16(%r14), %rcx
	cmpq	$0, (%rcx)
	je	LBB0_25
## %bb.24:
	movl	%eax, 4(%r12)
LBB0_25:
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	jmp	LBB0_26
	.cfi_endproc
                                        ## -- End function
	.comm	_MMC_ERR_INVALID,4,2            ## @MMC_ERR_INVALID
	.comm	_AML_MMC_CMD_START_BIT,4,2      ## @AML_MMC_CMD_START_BIT
	.comm	_AML_MMC_CMD_TRANS_BIT_HOST,4,2 ## @AML_MMC_CMD_TRANS_BIT_HOST
	.comm	_AML_MMC_CMD_TIMEOUT,4,2        ## @AML_MMC_CMD_TIMEOUT
	.comm	_MMC_RSP_136,4,2                ## @MMC_RSP_136
	.comm	_AML_MMC_CMD_RESP_CRC7_FROM_8,4,2 ## @AML_MMC_CMD_RESP_CRC7_FROM_8
	.comm	_AML_MMC_CMD_RESP_BITS_SHIFT,4,2 ## @AML_MMC_CMD_RESP_BITS_SHIFT
	.comm	_MMC_RSP_PRESENT,4,2            ## @MMC_RSP_PRESENT
	.comm	_MMC_RSP_CRC,4,2                ## @MMC_RSP_CRC
	.comm	_AML_MMC_CMD_RESP_NO_CRC7,4,2   ## @AML_MMC_CMD_RESP_NO_CRC7
	.comm	_MMC_RSP_BUSY,4,2               ## @MMC_RSP_BUSY
	.comm	_AML_MMC_CMD_CHECK_DAT0_BUSY,4,2 ## @AML_MMC_CMD_CHECK_DAT0_BUSY
	.comm	_MMC_DATA_READ,4,2              ## @MMC_DATA_READ
	.comm	_MMC_DATA_WRITE,4,2             ## @MMC_DATA_WRITE
	.comm	_MMC_DATA_MULTI,4,2             ## @MMC_DATA_MULTI
	.comm	_MMC_SECTOR_SIZE,4,2            ## @MMC_SECTOR_SIZE
	.comm	_AML_MMC_CMD_REP_PKG_CNT_SHIFT,4,2 ## @AML_MMC_CMD_REP_PKG_CNT_SHIFT
	.comm	_MMC_DATA_STREAM,4,2            ## @MMC_DATA_STREAM
	.comm	_AML_MMC_MULT_CONFIG_STREAM_EN,4,2 ## @AML_MMC_MULT_CONFIG_STREAM_EN
	.comm	_bus_width_4,8,3                ## @bus_width_4
	.comm	_AML_MMC_EXTENSION_PKT_SIZE_SHIFT,4,2 ## @AML_MMC_EXTENSION_PKT_SIZE_SHIFT
	.comm	_aml8726_mmc_mapmem,4,2         ## @aml8726_mmc_mapmem
	.comm	_BUS_DMA_NOWAIT,4,2             ## @BUS_DMA_NOWAIT
	.comm	_MMC_ERR_NO_MEMORY,4,2          ## @MMC_ERR_NO_MEMORY
	.comm	_AML_MMC_CMD_RESP_HAS_DATA,4,2  ## @AML_MMC_CMD_RESP_HAS_DATA
	.comm	_BUS_DMASYNC_PREREAD,4,2        ## @BUS_DMASYNC_PREREAD
	.comm	_AML_MMC_READ_TIMEOUT,4,2       ## @AML_MMC_READ_TIMEOUT
	.comm	_AML_MMC_CMD_CMD_HAS_DATA,4,2   ## @AML_MMC_CMD_CMD_HAS_DATA
	.comm	_BUS_DMASYNC_PREWRITE,4,2       ## @BUS_DMASYNC_PREWRITE
	.comm	_AML_MMC_WRITE_TIMEOUT,4,2      ## @AML_MMC_WRITE_TIMEOUT
	.comm	_MMC_ERR_NONE,4,2               ## @MMC_ERR_NONE
	.comm	_AML_MMC_MAX_TIMEOUT,4,2        ## @AML_MMC_MAX_TIMEOUT
	.comm	_aml8726_mmc_timeout,4,2        ## @aml8726_mmc_timeout
	.comm	_AML_MMC_CMD_ARGUMENT_REG,4,2   ## @AML_MMC_CMD_ARGUMENT_REG
	.comm	_AML_MMC_MULT_CONFIG_REG,4,2    ## @AML_MMC_MULT_CONFIG_REG
	.comm	_AML_MMC_EXTENSION_REG,4,2      ## @AML_MMC_EXTENSION_REG
	.comm	_AML_MMC_DMA_ADDR_REG,4,2       ## @AML_MMC_DMA_ADDR_REG
	.comm	_AML_MMC_CMD_SEND_REG,4,2       ## @AML_MMC_CMD_SEND_REG
	.no_dead_strip	_aml8726_mmc_start_command
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function aml8726_mmc_start_command
_aml8726_mmc_start_command:             ; @aml8726_mmc_start_command
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	ldr	w8, [x1]
	cmp	w8, #63
	b.le	LBB0_2
LBB0_1:
Lloh0:
	adrp	x25, _MMC_ERR_INVALID@GOTPAGE
Lloh1:
	ldr	x25, [x25, _MMC_ERR_INVALID@GOTPAGEOFF]
	b	LBB0_18
LBB0_2:
	mov	x20, x1
	mov	x19, x0
	mov	w1, #1
	bl	_aml8726_mmc_soft_reset
Lloh2:
	adrp	x8, _AML_MMC_CMD_START_BIT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AML_MMC_CMD_START_BIT@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _AML_MMC_CMD_TRANS_BIT_HOST@GOTPAGE
Lloh6:
	ldr	x9, [x9, _AML_MMC_CMD_TRANS_BIT_HOST@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w9, w9, w8
	ldr	w10, [x20]
	str	xzr, [sp, #24]
Lloh8:
	adrp	x8, _AML_MMC_CMD_TIMEOUT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AML_MMC_CMD_TIMEOUT@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	ldr	x11, [x20, #16]
	ldr	x11, [x11]
	cmp	x11, x20
	b.ne	LBB0_4
; %bb.3:
	ldr	w11, [x19, #4]
	cmp	w11, #0
	csel	w8, w8, w11, eq
LBB0_4:
	orr	w10, w9, w10
	ldr	w21, [x19]
	str	wzr, [x19, #4]
	ldr	w9, [x20, #4]
Lloh11:
	adrp	x11, _MMC_RSP_136@GOTPAGE
Lloh12:
	ldr	x11, [x11, _MMC_RSP_136@GOTPAGEOFF]
Lloh13:
	ldr	w11, [x11]
	tst	w11, w9
	b.eq	LBB0_6
; %bb.5:
Lloh14:
	adrp	x11, _AML_MMC_CMD_RESP_CRC7_FROM_8@GOTPAGE
Lloh15:
	ldr	x11, [x11, _AML_MMC_CMD_RESP_CRC7_FROM_8@GOTPAGEOFF]
Lloh16:
	ldr	w11, [x11]
	orr	w10, w11, w10
Lloh17:
	adrp	x11, _AML_MMC_CMD_RESP_BITS_SHIFT@GOTPAGE
Lloh18:
	ldr	x11, [x11, _AML_MMC_CMD_RESP_BITS_SHIFT@GOTPAGEOFF]
Lloh19:
	ldr	w11, [x11]
	mov	w12, #133
	lsl	w11, w12, w11
	orr	w10, w10, w11
	b	LBB0_8
LBB0_6:
Lloh20:
	adrp	x11, _MMC_RSP_PRESENT@GOTPAGE
Lloh21:
	ldr	x11, [x11, _MMC_RSP_PRESENT@GOTPAGEOFF]
Lloh22:
	ldr	w11, [x11]
	tst	w11, w9
	b.eq	LBB0_8
; %bb.7:
Lloh23:
	adrp	x11, _AML_MMC_CMD_RESP_BITS_SHIFT@GOTPAGE
Lloh24:
	ldr	x11, [x11, _AML_MMC_CMD_RESP_BITS_SHIFT@GOTPAGEOFF]
Lloh25:
	ldr	w11, [x11]
	mov	w12, #45
	lsl	w11, w12, w11
	orr	w10, w11, w10
LBB0_8:
Lloh26:
	adrp	x11, _MMC_RSP_CRC@GOTPAGE
Lloh27:
	ldr	x11, [x11, _MMC_RSP_CRC@GOTPAGEOFF]
Lloh28:
	ldr	w11, [x11]
Lloh29:
	adrp	x12, _AML_MMC_CMD_RESP_NO_CRC7@GOTPAGE
Lloh30:
	ldr	x12, [x12, _AML_MMC_CMD_RESP_NO_CRC7@GOTPAGEOFF]
Lloh31:
	ldr	w12, [x12]
	tst	w11, w9
	csel	w11, w12, wzr, eq
	orr	w10, w11, w10
Lloh32:
	adrp	x11, _MMC_RSP_BUSY@GOTPAGE
Lloh33:
	ldr	x11, [x11, _MMC_RSP_BUSY@GOTPAGEOFF]
Lloh34:
	adrp	x12, _AML_MMC_CMD_CHECK_DAT0_BUSY@GOTPAGE
Lloh35:
	ldr	x12, [x12, _AML_MMC_CMD_CHECK_DAT0_BUSY@GOTPAGEOFF]
Lloh36:
	ldr	w11, [x11]
Lloh37:
	ldr	w12, [x12]
	tst	w11, w9
	csel	w9, wzr, w12, eq
	orr	w22, w10, w9
	ldr	x24, [x20, #24]
	cbz	x24, LBB0_16
; %bb.9:
	ldr	w23, [x24]
	cbz	w23, LBB0_17
; %bb.10:
	ldr	w9, [x24, #4]
Lloh38:
	adrp	x26, _MMC_DATA_READ@GOTPAGE
Lloh39:
	ldr	x26, [x26, _MMC_DATA_READ@GOTPAGEOFF]
	ldr	w10, [x26]
Lloh40:
	adrp	x11, _MMC_DATA_WRITE@GOTPAGE
Lloh41:
	ldr	x11, [x11, _MMC_DATA_WRITE@GOTPAGEOFF]
Lloh42:
	ldr	w11, [x11]
	orr	w10, w11, w10
	tst	w10, w9
	b.eq	LBB0_16
; %bb.11:
Lloh43:
	adrp	x8, _MMC_DATA_MULTI@GOTPAGE
Lloh44:
	ldr	x8, [x8, _MMC_DATA_MULTI@GOTPAGEOFF]
Lloh45:
	ldr	w8, [x8]
	mov	x25, x23
	tst	w8, w9
	b.eq	LBB0_13
; %bb.12:
Lloh46:
	adrp	x8, _MMC_SECTOR_SIZE@GOTPAGE
Lloh47:
	ldr	x8, [x8, _MMC_SECTOR_SIZE@GOTPAGEOFF]
Lloh48:
	ldr	w25, [x8]
	sdiv	w8, w23, w25
	msub	w8, w8, w25, w23
	cbnz	w8, LBB0_1
LBB0_13:
Lloh49:
	adrp	x8, _MMC_DATA_STREAM@GOTPAGE
Lloh50:
	ldr	x8, [x8, _MMC_DATA_STREAM@GOTPAGEOFF]
Lloh51:
	ldr	w8, [x8]
Lloh52:
	adrp	x10, _AML_MMC_MULT_CONFIG_STREAM_EN@GOTPAGE
Lloh53:
	ldr	x10, [x10, _AML_MMC_MULT_CONFIG_STREAM_EN@GOTPAGEOFF]
Lloh54:
	ldr	w10, [x10]
	tst	w8, w9
	csel	w27, wzr, w10, eq
	ldr	x8, [x19, #32]
Lloh55:
	adrp	x9, _bus_width_4@GOTPAGE
Lloh56:
	ldr	x9, [x9, _bus_width_4@GOTPAGEOFF]
Lloh57:
	ldr	x9, [x9]
	cmp	x8, x9
	mov	w8, #-4
	csinv	w8, w8, wzr, eq
	mov	w9, #16
	mov	w10, #64
	csel	w9, w10, w9, eq
	add	w8, w8, w25, lsl #3
	add	w28, w8, w9
	cmp	w28, #4, lsl #12                ; =16384
	b.ge	LBB0_1
; %bb.14:
Lloh58:
	adrp	x8, _AML_MMC_CMD_REP_PKG_CNT_SHIFT@GOTPAGE
Lloh59:
	ldr	x8, [x8, _AML_MMC_CMD_REP_PKG_CNT_SHIFT@GOTPAGEOFF]
Lloh60:
	ldr	w8, [x8]
	str	x8, [sp, #8]                    ; 8-byte Folded Spill
Lloh61:
	adrp	x8, _AML_MMC_EXTENSION_PKT_SIZE_SHIFT@GOTPAGE
Lloh62:
	ldr	x8, [x8, _AML_MMC_EXTENSION_PKT_SIZE_SHIFT@GOTPAGEOFF]
Lloh63:
	ldr	w8, [x8]
	str	x8, [sp, #16]                   ; 8-byte Folded Spill
	ldp	w1, w0, [x19, #24]
	ldr	w2, [x24, #8]
Lloh64:
	adrp	x8, _aml8726_mmc_mapmem@GOTPAGE
Lloh65:
	ldr	x8, [x8, _aml8726_mmc_mapmem@GOTPAGEOFF]
Lloh66:
	ldr	w4, [x8]
Lloh67:
	adrp	x8, _BUS_DMA_NOWAIT@GOTPAGE
Lloh68:
	ldr	x8, [x8, _BUS_DMA_NOWAIT@GOTPAGEOFF]
Lloh69:
	ldr	w6, [x8]
	add	x5, sp, #24
	mov	x3, x23
	bl	_bus_dmamap_load
	cbz	w0, LBB0_19
; %bb.15:
Lloh70:
	adrp	x25, _MMC_ERR_NO_MEMORY@GOTPAGE
Lloh71:
	ldr	x25, [x25, _MMC_ERR_NO_MEMORY@GOTPAGEOFF]
	b	LBB0_18
LBB0_16:
	mov	w23, #0
LBB0_17:
	str	x20, [x19, #16]
Lloh72:
	adrp	x25, _MMC_ERR_NONE@GOTPAGE
Lloh73:
	ldr	x25, [x25, _MMC_ERR_NONE@GOTPAGEOFF]
	ldr	w9, [x25]
	str	w9, [x20, #8]
Lloh74:
	adrp	x9, _AML_MMC_MAX_TIMEOUT@GOTPAGE
Lloh75:
	ldr	x9, [x9, _AML_MMC_MAX_TIMEOUT@GOTPAGEOFF]
Lloh76:
	ldr	w9, [x9]
	cmp	w8, w9
	csel	w0, w8, w9, lt
	add	x24, x19, #8
	bl	_MSECS_TO_TICKS
	mov	x1, x0
Lloh77:
	adrp	x8, _aml8726_mmc_timeout@GOTPAGE
Lloh78:
	ldr	x8, [x8, _aml8726_mmc_timeout@GOTPAGEOFF]
Lloh79:
	ldr	w2, [x8]
	mov	x0, x24
	mov	x3, x19
	bl	_callout_reset
Lloh80:
	adrp	x8, _AML_MMC_CMD_ARGUMENT_REG@GOTPAGE
Lloh81:
	ldr	x8, [x8, _AML_MMC_CMD_ARGUMENT_REG@GOTPAGEOFF]
Lloh82:
	ldr	w1, [x8]
	ldr	w2, [x20, #12]
	mov	x0, x19
	bl	_CSR_WRITE_4
Lloh83:
	adrp	x8, _AML_MMC_MULT_CONFIG_REG@GOTPAGE
Lloh84:
	ldr	x8, [x8, _AML_MMC_MULT_CONFIG_REG@GOTPAGEOFF]
Lloh85:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x21
	bl	_CSR_WRITE_4
Lloh86:
	adrp	x8, _AML_MMC_EXTENSION_REG@GOTPAGE
Lloh87:
	ldr	x8, [x8, _AML_MMC_EXTENSION_REG@GOTPAGEOFF]
Lloh88:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x23
	bl	_CSR_WRITE_4
Lloh89:
	adrp	x8, _AML_MMC_DMA_ADDR_REG@GOTPAGE
Lloh90:
	ldr	x8, [x8, _AML_MMC_DMA_ADDR_REG@GOTPAGEOFF]
Lloh91:
	ldr	w1, [x8]
	ldr	w2, [sp, #24]
	mov	x0, x19
	bl	_CSR_WRITE_4
Lloh92:
	adrp	x20, _AML_MMC_CMD_SEND_REG@GOTPAGE
Lloh93:
	ldr	x20, [x20, _AML_MMC_CMD_SEND_REG@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	mov	x2, x22
	bl	_CSR_WRITE_4
	ldr	w1, [x20]
	mov	x0, x19
	bl	_CSR_BARRIER
LBB0_18:
	ldr	w0, [x25]
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_19:
	sdiv	w8, w23, w25
	sub	w8, w8, #1
	ldr	x9, [sp, #8]                    ; 8-byte Folded Reload
	lsl	w8, w8, w9
	orr	w22, w8, w22
	orr	w21, w27, w21
	ldr	x8, [sp, #16]                   ; 8-byte Folded Reload
	lsl	w23, w28, w8
	ldr	w8, [x24, #4]
Lloh94:
	adrp	x9, _AML_MMC_CMD_CMD_HAS_DATA@GOTPAGE
Lloh95:
	ldr	x9, [x9, _AML_MMC_CMD_CMD_HAS_DATA@GOTPAGEOFF]
Lloh96:
	adrp	x10, _AML_MMC_CMD_RESP_HAS_DATA@GOTPAGE
Lloh97:
	ldr	x10, [x10, _AML_MMC_CMD_RESP_HAS_DATA@GOTPAGEOFF]
	ldr	w11, [x26]
	tst	w11, w8
	csel	x8, x9, x10, eq
	ldr	w26, [x8]
	ldp	w1, w0, [x19, #24]
Lloh98:
	adrp	x8, _BUS_DMASYNC_PREWRITE@GOTPAGE
Lloh99:
	ldr	x8, [x8, _BUS_DMASYNC_PREWRITE@GOTPAGEOFF]
Lloh100:
	adrp	x9, _BUS_DMASYNC_PREREAD@GOTPAGE
Lloh101:
	ldr	x9, [x9, _BUS_DMASYNC_PREREAD@GOTPAGEOFF]
	csel	x8, x8, x9, eq
	ldr	w2, [x8]
Lloh102:
	adrp	x8, _AML_MMC_WRITE_TIMEOUT@GOTPAGE
Lloh103:
	ldr	x8, [x8, _AML_MMC_WRITE_TIMEOUT@GOTPAGEOFF]
Lloh104:
	adrp	x9, _AML_MMC_READ_TIMEOUT@GOTPAGE
Lloh105:
	ldr	x9, [x9, _AML_MMC_READ_TIMEOUT@GOTPAGEOFF]
	csel	x27, x8, x9, eq
	bl	_bus_dmamap_sync
	ldr	w8, [x27]
	ldr	w9, [x24]
	sdiv	w9, w9, w25
	mul	w8, w9, w8
	orr	w22, w22, w26
	ldr	x9, [x20, #16]
	ldr	x9, [x9]
	cbz	x9, LBB0_17
; %bb.20:
	str	w8, [x19, #4]
	b	LBB0_17
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh36
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGot	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh55, Lloh56, Lloh57
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh67, Lloh68, Lloh69
	.loh AdrpLdrGotLdr	Lloh64, Lloh65, Lloh66
	.loh AdrpLdrGotLdr	Lloh61, Lloh62, Lloh63
	.loh AdrpLdrGotLdr	Lloh58, Lloh59, Lloh60
	.loh AdrpLdrGot	Lloh70, Lloh71
	.loh AdrpLdrGot	Lloh92, Lloh93
	.loh AdrpLdrGotLdr	Lloh89, Lloh90, Lloh91
	.loh AdrpLdrGotLdr	Lloh86, Lloh87, Lloh88
	.loh AdrpLdrGotLdr	Lloh83, Lloh84, Lloh85
	.loh AdrpLdrGotLdr	Lloh80, Lloh81, Lloh82
	.loh AdrpLdrGotLdr	Lloh77, Lloh78, Lloh79
	.loh AdrpLdrGotLdr	Lloh74, Lloh75, Lloh76
	.loh AdrpLdrGot	Lloh72, Lloh73
	.loh AdrpLdrGot	Lloh104, Lloh105
	.loh AdrpLdrGot	Lloh102, Lloh103
	.loh AdrpLdrGot	Lloh100, Lloh101
	.loh AdrpLdrGot	Lloh98, Lloh99
	.loh AdrpLdrGot	Lloh96, Lloh97
	.loh AdrpLdrGot	Lloh94, Lloh95
	.cfi_endproc
                                        ; -- End function
	.comm	_MMC_ERR_INVALID,4,2            ; @MMC_ERR_INVALID
	.comm	_AML_MMC_CMD_START_BIT,4,2      ; @AML_MMC_CMD_START_BIT
	.comm	_AML_MMC_CMD_TRANS_BIT_HOST,4,2 ; @AML_MMC_CMD_TRANS_BIT_HOST
	.comm	_AML_MMC_CMD_TIMEOUT,4,2        ; @AML_MMC_CMD_TIMEOUT
	.comm	_MMC_RSP_136,4,2                ; @MMC_RSP_136
	.comm	_AML_MMC_CMD_RESP_CRC7_FROM_8,4,2 ; @AML_MMC_CMD_RESP_CRC7_FROM_8
	.comm	_AML_MMC_CMD_RESP_BITS_SHIFT,4,2 ; @AML_MMC_CMD_RESP_BITS_SHIFT
	.comm	_MMC_RSP_PRESENT,4,2            ; @MMC_RSP_PRESENT
	.comm	_MMC_RSP_CRC,4,2                ; @MMC_RSP_CRC
	.comm	_AML_MMC_CMD_RESP_NO_CRC7,4,2   ; @AML_MMC_CMD_RESP_NO_CRC7
	.comm	_MMC_RSP_BUSY,4,2               ; @MMC_RSP_BUSY
	.comm	_AML_MMC_CMD_CHECK_DAT0_BUSY,4,2 ; @AML_MMC_CMD_CHECK_DAT0_BUSY
	.comm	_MMC_DATA_READ,4,2              ; @MMC_DATA_READ
	.comm	_MMC_DATA_WRITE,4,2             ; @MMC_DATA_WRITE
	.comm	_MMC_DATA_MULTI,4,2             ; @MMC_DATA_MULTI
	.comm	_MMC_SECTOR_SIZE,4,2            ; @MMC_SECTOR_SIZE
	.comm	_AML_MMC_CMD_REP_PKG_CNT_SHIFT,4,2 ; @AML_MMC_CMD_REP_PKG_CNT_SHIFT
	.comm	_MMC_DATA_STREAM,4,2            ; @MMC_DATA_STREAM
	.comm	_AML_MMC_MULT_CONFIG_STREAM_EN,4,2 ; @AML_MMC_MULT_CONFIG_STREAM_EN
	.comm	_bus_width_4,8,3                ; @bus_width_4
	.comm	_AML_MMC_EXTENSION_PKT_SIZE_SHIFT,4,2 ; @AML_MMC_EXTENSION_PKT_SIZE_SHIFT
	.comm	_aml8726_mmc_mapmem,4,2         ; @aml8726_mmc_mapmem
	.comm	_BUS_DMA_NOWAIT,4,2             ; @BUS_DMA_NOWAIT
	.comm	_MMC_ERR_NO_MEMORY,4,2          ; @MMC_ERR_NO_MEMORY
	.comm	_AML_MMC_CMD_RESP_HAS_DATA,4,2  ; @AML_MMC_CMD_RESP_HAS_DATA
	.comm	_BUS_DMASYNC_PREREAD,4,2        ; @BUS_DMASYNC_PREREAD
	.comm	_AML_MMC_READ_TIMEOUT,4,2       ; @AML_MMC_READ_TIMEOUT
	.comm	_AML_MMC_CMD_CMD_HAS_DATA,4,2   ; @AML_MMC_CMD_CMD_HAS_DATA
	.comm	_BUS_DMASYNC_PREWRITE,4,2       ; @BUS_DMASYNC_PREWRITE
	.comm	_AML_MMC_WRITE_TIMEOUT,4,2      ; @AML_MMC_WRITE_TIMEOUT
	.comm	_MMC_ERR_NONE,4,2               ; @MMC_ERR_NONE
	.comm	_AML_MMC_MAX_TIMEOUT,4,2        ; @AML_MMC_MAX_TIMEOUT
	.comm	_aml8726_mmc_timeout,4,2        ; @aml8726_mmc_timeout
	.comm	_AML_MMC_CMD_ARGUMENT_REG,4,2   ; @AML_MMC_CMD_ARGUMENT_REG
	.comm	_AML_MMC_MULT_CONFIG_REG,4,2    ; @AML_MMC_MULT_CONFIG_REG
	.comm	_AML_MMC_EXTENSION_REG,4,2      ; @AML_MMC_EXTENSION_REG
	.comm	_AML_MMC_DMA_ADDR_REG,4,2       ; @AML_MMC_DMA_ADDR_REG
	.comm	_AML_MMC_CMD_SEND_REG,4,2       ; @AML_MMC_CMD_SEND_REG
	.no_dead_strip	_aml8726_mmc_start_command
.subsections_via_symbols
