	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function meson_mmc_start_cmd
_meson_mmc_start_cmd:                   ## @meson_mmc_start_cmd
	.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, %r15
	movq	%rdi, %r12
	callq	_mmc_priv
	movq	%rax, %r14
	movq	8(%r15), %rbx
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_dma_rmb
	movq	%r15, 24(%r14)
	movq	_CMD_CFG_CMD_INDEX_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r15), %esi
	callq	_FIELD_PREP
	movq	_CMD_CFG_OWNER@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_CMD_CFG_ERROR@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, -44(%rbp)
	leaq	-44(%rbp), %rsi
	movq	%r15, %rdi
	callq	_meson_mmc_set_response_bits
	testq	%rbx, %rbx
	je	LBB0_9
## %bb.1:
	movq	$0, 24(%rbx)
	movq	_CMD_CFG_DATA_IO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, -44(%rbp)
	movq	_CMD_CFG_TIMEOUT_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	%rbx, %rdi
	callq	_meson_mmc_get_timeout_msecs
	movl	%eax, %edi
	callq	_ilog2
	movl	%r13d, %edi
	movl	%eax, %esi
	callq	_FIELD_PREP
	orl	%eax, -44(%rbp)
	movq	%rbx, %rdi
	callq	_meson_mmc_desc_chain_mode
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movl	-44(%rbp), %esi
	movq	%r12, %rdi
	callq	_meson_mmc_desc_chain_transfer
	jmp	LBB0_11
LBB0_9:
	movq	_CMD_CFG_TIMEOUT_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_SD_EMMC_CMD_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ilog2
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_FIELD_PREP
	movl	%eax, %edi
	orl	-44(%rbp), %edi
	jmp	LBB0_10
LBB0_3:
	cmpl	$2, (%rbx)
	jl	LBB0_5
## %bb.4:
	movq	_CMD_CFG_BLOCK_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, -44(%rbp)
	movq	_CMD_CFG_LENGTH_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%rbx), %esi
	callq	_FIELD_PREP
	orl	%eax, -44(%rbp)
	movl	4(%rbx), %esi
	movq	%r12, %rdi
	callq	_meson_mmc_set_blksz
	jmp	LBB0_6
LBB0_5:
	movq	_CMD_CFG_LENGTH_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	4(%rbx), %esi
	callq	_FIELD_PREP
	orl	%eax, -44(%rbp)
LBB0_6:
	movq	_MMC_DATA_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%rbx)
	je	LBB0_8
## %bb.7:
	movl	(%rbx), %r12d
	imull	4(%rbx), %r12d
	movq	_CMD_CFG_DATA_WR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, -44(%rbp)
	xorl	%edi, %edi
	cmpl	(%r14), %r12d
	seta	%dil
	callq	_WARN_ON
	movl	12(%rbx), %esi
	movl	16(%rbx), %edi
	movl	16(%r14), %edx
	movl	%r12d, %ecx
	callq	_sg_copy_to_buffer
	xorl	%eax, %eax
	callq	_dma_wmb
LBB0_8:
	movq	_CMD_DATA_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	andl	4(%r14), %r13d
	movl	-44(%rbp), %edi
LBB0_10:
	movq	_CMD_CFG_END_OF_CHAIN@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	movl	%edi, -44(%rbp)
	movq	_SD_EMMC_CMD_CFG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r14), %rsi
	callq	_writel
	movq	_SD_EMMC_CMD_DAT@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r14), %rsi
	movl	%r13d, %edi
	callq	_writel
	movq	_SD_EMMC_CMD_RSP@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r14), %rsi
	xorl	%edi, %edi
	callq	_writel
	xorl	%eax, %eax
	callq	_wmb
	movl	4(%r15), %edi
	movq	_SD_EMMC_CMD_ARG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r14), %rsi
	callq	_writel
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CMD_CFG_CMD_INDEX_MASK,4,2     ## @CMD_CFG_CMD_INDEX_MASK
	.comm	_CMD_CFG_OWNER,4,2              ## @CMD_CFG_OWNER
	.comm	_CMD_CFG_ERROR,4,2              ## @CMD_CFG_ERROR
	.comm	_CMD_CFG_DATA_IO,4,2            ## @CMD_CFG_DATA_IO
	.comm	_CMD_CFG_TIMEOUT_MASK,4,2       ## @CMD_CFG_TIMEOUT_MASK
	.comm	_CMD_CFG_BLOCK_MODE,4,2         ## @CMD_CFG_BLOCK_MODE
	.comm	_CMD_CFG_LENGTH_MASK,4,2        ## @CMD_CFG_LENGTH_MASK
	.comm	_MMC_DATA_WRITE,4,2             ## @MMC_DATA_WRITE
	.comm	_CMD_CFG_DATA_WR,4,2            ## @CMD_CFG_DATA_WR
	.comm	_CMD_DATA_MASK,4,2              ## @CMD_DATA_MASK
	.comm	_SD_EMMC_CMD_TIMEOUT,4,2        ## @SD_EMMC_CMD_TIMEOUT
	.comm	_CMD_CFG_END_OF_CHAIN,4,2       ## @CMD_CFG_END_OF_CHAIN
	.comm	_SD_EMMC_CMD_CFG,8,3            ## @SD_EMMC_CMD_CFG
	.comm	_SD_EMMC_CMD_DAT,8,3            ## @SD_EMMC_CMD_DAT
	.comm	_SD_EMMC_CMD_RSP,8,3            ## @SD_EMMC_CMD_RSP
	.comm	_SD_EMMC_CMD_ARG,8,3            ## @SD_EMMC_CMD_ARG
	.no_dead_strip	_meson_mmc_start_cmd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function meson_mmc_start_cmd
_meson_mmc_start_cmd:                   ; @meson_mmc_start_cmd
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x22, x0
	bl	_mmc_priv
	mov	x20, x0
	ldr	x21, [x19, #8]
	bl	_dma_rmb
	str	x19, [x20, #24]
Lloh0:
	adrp	x8, _CMD_CFG_CMD_INDEX_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CMD_CFG_CMD_INDEX_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	ldr	w1, [x19]
	bl	_FIELD_PREP
Lloh3:
	adrp	x8, _CMD_CFG_OWNER@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CMD_CFG_OWNER@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	orr	w8, w8, w0
Lloh6:
	adrp	x9, _CMD_CFG_ERROR@GOTPAGE
Lloh7:
	ldr	x9, [x9, _CMD_CFG_ERROR@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [sp, #12]
	add	x1, sp, #12
	mov	x0, x19
	bl	_meson_mmc_set_response_bits
	cbz	x21, LBB0_3
; %bb.1:
	str	xzr, [x21, #24]
Lloh9:
	adrp	x8, _CMD_CFG_DATA_IO@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CMD_CFG_DATA_IO@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	ldr	w9, [sp, #12]
	orr	w8, w9, w8
	str	w8, [sp, #12]
Lloh12:
	adrp	x8, _CMD_CFG_TIMEOUT_MASK@GOTPAGE
Lloh13:
	ldr	x8, [x8, _CMD_CFG_TIMEOUT_MASK@GOTPAGEOFF]
Lloh14:
	ldr	w23, [x8]
	mov	x0, x21
	bl	_meson_mmc_get_timeout_msecs
	bl	_ilog2
	mov	x1, x0
	mov	x0, x23
	bl	_FIELD_PREP
	ldr	w8, [sp, #12]
	orr	w8, w8, w0
	str	w8, [sp, #12]
	mov	x0, x21
	bl	_meson_mmc_desc_chain_mode
	cbz	x0, LBB0_4
; %bb.2:
	ldr	w1, [sp, #12]
	mov	x0, x22
	bl	_meson_mmc_desc_chain_transfer
	b	LBB0_11
LBB0_3:
Lloh15:
	adrp	x8, _CMD_CFG_TIMEOUT_MASK@GOTPAGE
Lloh16:
	ldr	x8, [x8, _CMD_CFG_TIMEOUT_MASK@GOTPAGEOFF]
Lloh17:
	ldr	w21, [x8]
Lloh18:
	adrp	x8, _SD_EMMC_CMD_TIMEOUT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _SD_EMMC_CMD_TIMEOUT@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	bl	_ilog2
	mov	x1, x0
	mov	x0, x21
	bl	_FIELD_PREP
	mov	w21, #0
	ldr	w8, [sp, #12]
	orr	w8, w8, w0
	b	LBB0_10
LBB0_4:
	ldr	w8, [x21]
	cmp	w8, #2
	b.lt	LBB0_6
; %bb.5:
Lloh21:
	adrp	x8, _CMD_CFG_BLOCK_MODE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _CMD_CFG_BLOCK_MODE@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	ldr	w9, [sp, #12]
	orr	w8, w9, w8
	str	w8, [sp, #12]
Lloh24:
	adrp	x8, _CMD_CFG_LENGTH_MASK@GOTPAGE
Lloh25:
	ldr	x8, [x8, _CMD_CFG_LENGTH_MASK@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
	ldr	w1, [x21]
	bl	_FIELD_PREP
	ldr	w8, [sp, #12]
	orr	w8, w8, w0
	str	w8, [sp, #12]
	ldr	w1, [x21, #4]
	mov	x0, x22
	bl	_meson_mmc_set_blksz
	b	LBB0_7
LBB0_6:
Lloh27:
	adrp	x8, _CMD_CFG_LENGTH_MASK@GOTPAGE
Lloh28:
	ldr	x8, [x8, _CMD_CFG_LENGTH_MASK@GOTPAGEOFF]
Lloh29:
	ldr	w0, [x8]
	ldr	w1, [x21, #4]
	bl	_FIELD_PREP
	ldr	w8, [sp, #12]
	orr	w8, w8, w0
	str	w8, [sp, #12]
LBB0_7:
	ldr	w8, [x21, #8]
Lloh30:
	adrp	x9, _MMC_DATA_WRITE@GOTPAGE
Lloh31:
	ldr	x9, [x9, _MMC_DATA_WRITE@GOTPAGEOFF]
Lloh32:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
; %bb.8:
	ldp	w9, w8, [x21]
	mul	w22, w9, w8
Lloh33:
	adrp	x8, _CMD_CFG_DATA_WR@GOTPAGE
Lloh34:
	ldr	x8, [x8, _CMD_CFG_DATA_WR@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	ldr	w9, [sp, #12]
	orr	w8, w9, w8
	str	w8, [sp, #12]
	ldr	w8, [x20]
	cmp	w22, w8
	cset	w0, hi
	bl	_WARN_ON
	ldp	w1, w0, [x21, #12]
	ldr	w2, [x20, #16]
	mov	x3, x22
	bl	_sg_copy_to_buffer
	bl	_dma_wmb
LBB0_9:
	ldr	w8, [x20, #4]
Lloh36:
	adrp	x9, _CMD_DATA_MASK@GOTPAGE
Lloh37:
	ldr	x9, [x9, _CMD_DATA_MASK@GOTPAGEOFF]
Lloh38:
	ldr	w9, [x9]
	and	w21, w9, w8
	ldr	w8, [sp, #12]
LBB0_10:
Lloh39:
	adrp	x9, _CMD_CFG_END_OF_CHAIN@GOTPAGE
Lloh40:
	ldr	x9, [x9, _CMD_CFG_END_OF_CHAIN@GOTPAGEOFF]
Lloh41:
	ldr	w9, [x9]
	orr	w0, w8, w9
	str	w0, [sp, #12]
	ldr	x8, [x20, #8]
Lloh42:
	adrp	x9, _SD_EMMC_CMD_CFG@GOTPAGE
Lloh43:
	ldr	x9, [x9, _SD_EMMC_CMD_CFG@GOTPAGEOFF]
Lloh44:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	ldr	x8, [x20, #8]
Lloh45:
	adrp	x9, _SD_EMMC_CMD_DAT@GOTPAGE
Lloh46:
	ldr	x9, [x9, _SD_EMMC_CMD_DAT@GOTPAGEOFF]
Lloh47:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	x0, x21
	bl	_writel
	ldr	x8, [x20, #8]
Lloh48:
	adrp	x9, _SD_EMMC_CMD_RSP@GOTPAGE
Lloh49:
	ldr	x9, [x9, _SD_EMMC_CMD_RSP@GOTPAGEOFF]
Lloh50:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	w0, #0
	bl	_writel
	bl	_wmb
	ldr	w0, [x19, #4]
	ldr	x8, [x20, #8]
Lloh51:
	adrp	x9, _SD_EMMC_CMD_ARG@GOTPAGE
Lloh52:
	ldr	x9, [x9, _SD_EMMC_CMD_ARG@GOTPAGEOFF]
Lloh53:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
LBB0_11:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.comm	_CMD_CFG_CMD_INDEX_MASK,4,2     ; @CMD_CFG_CMD_INDEX_MASK
	.comm	_CMD_CFG_OWNER,4,2              ; @CMD_CFG_OWNER
	.comm	_CMD_CFG_ERROR,4,2              ; @CMD_CFG_ERROR
	.comm	_CMD_CFG_DATA_IO,4,2            ; @CMD_CFG_DATA_IO
	.comm	_CMD_CFG_TIMEOUT_MASK,4,2       ; @CMD_CFG_TIMEOUT_MASK
	.comm	_CMD_CFG_BLOCK_MODE,4,2         ; @CMD_CFG_BLOCK_MODE
	.comm	_CMD_CFG_LENGTH_MASK,4,2        ; @CMD_CFG_LENGTH_MASK
	.comm	_MMC_DATA_WRITE,4,2             ; @MMC_DATA_WRITE
	.comm	_CMD_CFG_DATA_WR,4,2            ; @CMD_CFG_DATA_WR
	.comm	_CMD_DATA_MASK,4,2              ; @CMD_DATA_MASK
	.comm	_SD_EMMC_CMD_TIMEOUT,4,2        ; @SD_EMMC_CMD_TIMEOUT
	.comm	_CMD_CFG_END_OF_CHAIN,4,2       ; @CMD_CFG_END_OF_CHAIN
	.comm	_SD_EMMC_CMD_CFG,8,3            ; @SD_EMMC_CMD_CFG
	.comm	_SD_EMMC_CMD_DAT,8,3            ; @SD_EMMC_CMD_DAT
	.comm	_SD_EMMC_CMD_RSP,8,3            ; @SD_EMMC_CMD_RSP
	.comm	_SD_EMMC_CMD_ARG,8,3            ; @SD_EMMC_CMD_ARG
	.no_dead_strip	_meson_mmc_start_cmd
.subsections_via_symbols
