	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function jz4740_mmc_send_command
_jz4740_mmc_send_command:               ## @jz4740_mmc_send_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	movl	(%rdi), %ebx
	movq	_JZ_MMC_CMDAT_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%ebx, %eax
	movl	%eax, (%rdi)
	callq	_jz4740_mmc_clock_disable
	movq	%r14, 32(%r15)
	movq	_MMC_RSP_BUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	andl	(%r14), %r12d
	je	LBB0_2
## %bb.1:
	movq	_JZ_MMC_CMDAT_BUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
LBB0_2:
	orl	%ebx, %r12d
	movq	%r14, %rdi
	callq	_mmc_resp_type
                                        ## kill: def $eax killed $eax def $rax
	leal	-130(%rax), %ecx
	cmpl	$2, %ecx
	jb	LBB0_20
## %bb.3:
	cmpl	$128, %eax
	je	LBB0_6
## %bb.4:
	cmpl	$129, %eax
	jne	LBB0_8
## %bb.5:
	movq	_JZ_MMC_CMDAT_RSP_R2@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_20:
	movq	_JZ_MMC_CMDAT_RSP_R1@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_6:
	movq	_JZ_MMC_CMDAT_RSP_R3@GOTPCREL(%rip), %rax
LBB0_7:
	orl	(%rax), %r12d
LBB0_8:
	movq	16(%r14), %rax
	testq	%rax, %rax
	je	LBB0_19
## %bb.9:
	movq	_JZ_MMC_CMDAT_DATA_EN@GOTPCREL(%rip), %rcx
	orl	(%rcx), %r12d
	movq	_MMC_DATA_WRITE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	(%rax), %ecx
	je	LBB0_11
## %bb.10:
	movq	_JZ_MMC_CMDAT_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
LBB0_11:
	orl	%ecx, %r12d
	cmpq	$0, 24(%r15)
	movq	8(%r15), %rax
	movq	_JZ_MMC_JZ4780@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	je	LBB0_15
## %bb.12:
	cmpq	%rcx, %rax
	jge	LBB0_13
## %bb.14:
	movq	_JZ_MMC_CMDAT_DMA_EN@GOTPCREL(%rip), %rax
	orl	(%rax), %r12d
	jmp	LBB0_18
LBB0_15:
	cmpq	%rcx, %rax
	jl	LBB0_18
## %bb.16:
	movq	_JZ_REG_MMC_DMAC@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%r15), %rsi
	xorl	%edi, %edi
	jmp	LBB0_17
LBB0_13:
	movq	_JZ_MMC_DMAC_DMA_EN@GOTPCREL(%rip), %rax
	movq	_JZ_MMC_DMAC_DMA_SEL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	movq	_JZ_REG_MMC_DMAC@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%r15), %rsi
LBB0_17:
	callq	_writel
LBB0_18:
	movq	16(%r14), %rax
	movl	8(%rax), %edi
	movq	_JZ_REG_MMC_BLKLEN@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%r15), %rsi
	callq	_writew
	movq	16(%r14), %rax
	movl	4(%rax), %edi
	movq	_JZ_REG_MMC_NOB@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%r15), %rsi
	callq	_writew
LBB0_19:
	movl	8(%r14), %edi
	movq	_JZ_REG_MMC_CMD@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%r15), %rsi
	callq	_writeb
	movl	4(%r14), %edi
	movq	_JZ_REG_MMC_ARG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%r15), %rsi
	callq	_writel
	movq	_JZ_REG_MMC_CMDAT@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%r15), %rsi
	movl	%r12d, %edi
	callq	_writel
	movq	%r15, %rdi
	movl	$1, %esi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_jz4740_mmc_clock_enable        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_JZ_MMC_CMDAT_INIT,4,2          ## @JZ_MMC_CMDAT_INIT
	.comm	_MMC_RSP_BUSY,4,2               ## @MMC_RSP_BUSY
	.comm	_JZ_MMC_CMDAT_BUSY,4,2          ## @JZ_MMC_CMDAT_BUSY
	.comm	_JZ_MMC_CMDAT_RSP_R1,4,2        ## @JZ_MMC_CMDAT_RSP_R1
	.comm	_JZ_MMC_CMDAT_RSP_R2,4,2        ## @JZ_MMC_CMDAT_RSP_R2
	.comm	_JZ_MMC_CMDAT_RSP_R3,4,2        ## @JZ_MMC_CMDAT_RSP_R3
	.comm	_JZ_MMC_CMDAT_DATA_EN,4,2       ## @JZ_MMC_CMDAT_DATA_EN
	.comm	_MMC_DATA_WRITE,4,2             ## @MMC_DATA_WRITE
	.comm	_JZ_MMC_CMDAT_WRITE,4,2         ## @JZ_MMC_CMDAT_WRITE
	.comm	_JZ_MMC_JZ4780,8,3              ## @JZ_MMC_JZ4780
	.comm	_JZ_MMC_DMAC_DMA_EN,4,2         ## @JZ_MMC_DMAC_DMA_EN
	.comm	_JZ_MMC_DMAC_DMA_SEL,4,2        ## @JZ_MMC_DMAC_DMA_SEL
	.comm	_JZ_REG_MMC_DMAC,8,3            ## @JZ_REG_MMC_DMAC
	.comm	_JZ_MMC_CMDAT_DMA_EN,4,2        ## @JZ_MMC_CMDAT_DMA_EN
	.comm	_JZ_REG_MMC_BLKLEN,8,3          ## @JZ_REG_MMC_BLKLEN
	.comm	_JZ_REG_MMC_NOB,8,3             ## @JZ_REG_MMC_NOB
	.comm	_JZ_REG_MMC_CMD,8,3             ## @JZ_REG_MMC_CMD
	.comm	_JZ_REG_MMC_ARG,8,3             ## @JZ_REG_MMC_ARG
	.comm	_JZ_REG_MMC_CMDAT,8,3           ## @JZ_REG_MMC_CMDAT
	.no_dead_strip	_jz4740_mmc_send_command
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function jz4740_mmc_send_command
_jz4740_mmc_send_command:               ; @jz4740_mmc_send_command
	.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	x20, x1
	mov	x19, x0
	ldr	w21, [x0]
Lloh0:
	adrp	x8, _JZ_MMC_CMDAT_INIT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _JZ_MMC_CMDAT_INIT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	bic	w8, w21, w8
	str	w8, [x0]
	bl	_jz4740_mmc_clock_disable
	str	x20, [x19, #32]
	ldr	w8, [x20]
Lloh3:
	adrp	x9, _MMC_RSP_BUSY@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MMC_RSP_BUSY@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
Lloh6:
	adrp	x10, _JZ_MMC_CMDAT_BUSY@GOTPAGE
Lloh7:
	ldr	x10, [x10, _JZ_MMC_CMDAT_BUSY@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	tst	w9, w8
	csel	w8, wzr, w10, eq
	orr	w21, w8, w21
	mov	x0, x20
	bl	_mmc_resp_type
	sub	w8, w0, #130
	cmp	w8, #2
	b.lo	LBB0_4
; %bb.1:
	cmp	w0, #128
	b.eq	LBB0_5
; %bb.2:
	cmp	w0, #129
	b.ne	LBB0_7
; %bb.3:
Lloh9:
	adrp	x8, _JZ_MMC_CMDAT_RSP_R2@GOTPAGE
Lloh10:
	ldr	x8, [x8, _JZ_MMC_CMDAT_RSP_R2@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:
Lloh11:
	adrp	x8, _JZ_MMC_CMDAT_RSP_R1@GOTPAGE
Lloh12:
	ldr	x8, [x8, _JZ_MMC_CMDAT_RSP_R1@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh13:
	adrp	x8, _JZ_MMC_CMDAT_RSP_R3@GOTPAGE
Lloh14:
	ldr	x8, [x8, _JZ_MMC_CMDAT_RSP_R3@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	orr	w21, w8, w21
LBB0_7:
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_16
; %bb.8:
Lloh15:
	adrp	x9, _JZ_MMC_CMDAT_DATA_EN@GOTPAGE
Lloh16:
	ldr	x9, [x9, _JZ_MMC_CMDAT_DATA_EN@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	orr	w9, w9, w21
	ldr	w8, [x8]
Lloh18:
	adrp	x10, _MMC_DATA_WRITE@GOTPAGE
Lloh19:
	ldr	x10, [x10, _MMC_DATA_WRITE@GOTPAGEOFF]
Lloh20:
	ldr	w10, [x10]
Lloh21:
	adrp	x11, _JZ_MMC_CMDAT_WRITE@GOTPAGE
Lloh22:
	ldr	x11, [x11, _JZ_MMC_CMDAT_WRITE@GOTPAGEOFF]
Lloh23:
	ldr	w11, [x11]
	tst	w10, w8
	csel	w8, wzr, w11, eq
	orr	w21, w9, w8
	ldr	x10, [x19, #24]
	ldr	x8, [x19, #8]
Lloh24:
	adrp	x9, _JZ_MMC_JZ4780@GOTPAGE
Lloh25:
	ldr	x9, [x9, _JZ_MMC_JZ4780@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	cmp	x8, x9
	cbz	x10, LBB0_11
; %bb.9:
	b.ge	LBB0_13
; %bb.10:
Lloh27:
	adrp	x8, _JZ_MMC_CMDAT_DMA_EN@GOTPAGE
Lloh28:
	ldr	x8, [x8, _JZ_MMC_CMDAT_DMA_EN@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	orr	w21, w8, w21
	b	LBB0_15
LBB0_11:
	b.lt	LBB0_15
; %bb.12:
	ldr	x8, [x19, #16]
Lloh30:
	adrp	x9, _JZ_REG_MMC_DMAC@GOTPAGE
Lloh31:
	ldr	x9, [x9, _JZ_REG_MMC_DMAC@GOTPAGEOFF]
Lloh32:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	w0, #0
	b	LBB0_14
LBB0_13:
Lloh33:
	adrp	x8, _JZ_MMC_DMAC_DMA_EN@GOTPAGE
Lloh34:
	ldr	x8, [x8, _JZ_MMC_DMAC_DMA_EN@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
Lloh36:
	adrp	x9, _JZ_MMC_DMAC_DMA_SEL@GOTPAGE
Lloh37:
	ldr	x9, [x9, _JZ_MMC_DMAC_DMA_SEL@GOTPAGEOFF]
Lloh38:
	ldr	w9, [x9]
	orr	w0, w9, w8
	ldr	x8, [x19, #16]
Lloh39:
	adrp	x9, _JZ_REG_MMC_DMAC@GOTPAGE
Lloh40:
	ldr	x9, [x9, _JZ_REG_MMC_DMAC@GOTPAGEOFF]
Lloh41:
	ldr	x9, [x9]
	add	x1, x9, x8
LBB0_14:
	bl	_writel
LBB0_15:
	ldr	x8, [x20, #16]
	ldr	w0, [x8, #8]
	ldr	x8, [x19, #16]
Lloh42:
	adrp	x9, _JZ_REG_MMC_BLKLEN@GOTPAGE
Lloh43:
	ldr	x9, [x9, _JZ_REG_MMC_BLKLEN@GOTPAGEOFF]
Lloh44:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writew
	ldr	x8, [x20, #16]
	ldr	w0, [x8, #4]
	ldr	x8, [x19, #16]
Lloh45:
	adrp	x9, _JZ_REG_MMC_NOB@GOTPAGE
Lloh46:
	ldr	x9, [x9, _JZ_REG_MMC_NOB@GOTPAGEOFF]
Lloh47:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writew
LBB0_16:
	ldr	w0, [x20, #8]
	ldr	x8, [x19, #16]
Lloh48:
	adrp	x9, _JZ_REG_MMC_CMD@GOTPAGE
Lloh49:
	ldr	x9, [x9, _JZ_REG_MMC_CMD@GOTPAGEOFF]
Lloh50:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writeb
	ldr	w0, [x20, #4]
	ldr	x8, [x19, #16]
Lloh51:
	adrp	x9, _JZ_REG_MMC_ARG@GOTPAGE
Lloh52:
	ldr	x9, [x9, _JZ_REG_MMC_ARG@GOTPAGEOFF]
Lloh53:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	ldr	x8, [x19, #16]
Lloh54:
	adrp	x9, _JZ_REG_MMC_CMDAT@GOTPAGE
Lloh55:
	ldr	x9, [x9, _JZ_REG_MMC_CMDAT@GOTPAGEOFF]
Lloh56:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	x0, x21
	bl	_writel
	mov	x0, x19
	mov	w1, #1
	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	_jz4740_mmc_clock_enable
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh54, Lloh55, Lloh56
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.cfi_endproc
                                        ; -- End function
	.comm	_JZ_MMC_CMDAT_INIT,4,2          ; @JZ_MMC_CMDAT_INIT
	.comm	_MMC_RSP_BUSY,4,2               ; @MMC_RSP_BUSY
	.comm	_JZ_MMC_CMDAT_BUSY,4,2          ; @JZ_MMC_CMDAT_BUSY
	.comm	_JZ_MMC_CMDAT_RSP_R1,4,2        ; @JZ_MMC_CMDAT_RSP_R1
	.comm	_JZ_MMC_CMDAT_RSP_R2,4,2        ; @JZ_MMC_CMDAT_RSP_R2
	.comm	_JZ_MMC_CMDAT_RSP_R3,4,2        ; @JZ_MMC_CMDAT_RSP_R3
	.comm	_JZ_MMC_CMDAT_DATA_EN,4,2       ; @JZ_MMC_CMDAT_DATA_EN
	.comm	_MMC_DATA_WRITE,4,2             ; @MMC_DATA_WRITE
	.comm	_JZ_MMC_CMDAT_WRITE,4,2         ; @JZ_MMC_CMDAT_WRITE
	.comm	_JZ_MMC_JZ4780,8,3              ; @JZ_MMC_JZ4780
	.comm	_JZ_MMC_DMAC_DMA_EN,4,2         ; @JZ_MMC_DMAC_DMA_EN
	.comm	_JZ_MMC_DMAC_DMA_SEL,4,2        ; @JZ_MMC_DMAC_DMA_SEL
	.comm	_JZ_REG_MMC_DMAC,8,3            ; @JZ_REG_MMC_DMAC
	.comm	_JZ_MMC_CMDAT_DMA_EN,4,2        ; @JZ_MMC_CMDAT_DMA_EN
	.comm	_JZ_REG_MMC_BLKLEN,8,3          ; @JZ_REG_MMC_BLKLEN
	.comm	_JZ_REG_MMC_NOB,8,3             ; @JZ_REG_MMC_NOB
	.comm	_JZ_REG_MMC_CMD,8,3             ; @JZ_REG_MMC_CMD
	.comm	_JZ_REG_MMC_ARG,8,3             ; @JZ_REG_MMC_ARG
	.comm	_JZ_REG_MMC_CMDAT,8,3           ; @JZ_REG_MMC_CMDAT
	.no_dead_strip	_jz4740_mmc_send_command
.subsections_via_symbols
