	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function esdhc_cqe_enable
_esdhc_cqe_enable:                      ## @esdhc_cqe_enable
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	callq	_mmc_priv
	movq	%rax, %r12
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	(%rbx), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_SDHCI_PRESENT_STATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_sdhci_readl
	movq	_SDHCI_DATA_AVAILABLE@GOTPCREL(%rip), %r15
	testl	%eax, (%r15)
	je	LBB0_5
## %bb.1:
	movl	$-11, %r14d
	movq	_SDHCI_BUFFER@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %esi
	movq	%r12, %rdi
	callq	_sdhci_readl
	movq	_SDHCI_PRESENT_STATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_sdhci_readl
	incl	%r14d
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%eax, %ebx
	movl	$1, %edi
	callq	_mdelay
	testl	%ebx, (%r15)
	jne	LBB0_2
	jmp	LBB0_5
LBB0_3:
	movl	8(%r12), %edi
	callq	_mmc_dev
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	callq	_dev_warn
LBB0_5:
	movq	_SDHCI_TRANSFER_MODE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_sdhci_readw
	movq	_SDHCI_REQ_USE_DMA@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	andl	(%r12), %esi
	je	LBB0_7
## %bb.6:
	movq	_SDHCI_TRNS_DMA@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
LBB0_7:
	orl	%eax, %esi
	movq	_SDHCI_QUIRK2_SUPPORT_SINGLE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$0, %eax
	andl	4(%r12), %ecx
	jne	LBB0_9
## %bb.8:
	movq	_SDHCI_TRNS_BLK_CNT_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_9:
	orl	%eax, %esi
	movl	(%rbx), %edx
	movq	%r12, %rdi
	callq	_sdhci_writew
	movq	_CQHCI_CTL@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_cqhci_writel
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_cqhci_readl
	testq	%rax, %rax
	je	LBB0_12
## %bb.10:
	movq	_CQHCI_HALT@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_12
## %bb.11:
	movl	8(%r12), %edi
	callq	_mmc_dev
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edi
	callq	_dev_err
LBB0_12:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_sdhci_cqe_enable               ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_SDHCI_PRESENT_STATE,4,2        ## @SDHCI_PRESENT_STATE
	.comm	_SDHCI_DATA_AVAILABLE,4,2       ## @SDHCI_DATA_AVAILABLE
	.comm	_SDHCI_BUFFER,4,2               ## @SDHCI_BUFFER
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"CQE may get stuck because the Buffer Read Enable bit is set\n"

	.comm	_SDHCI_TRANSFER_MODE,4,2        ## @SDHCI_TRANSFER_MODE
	.comm	_SDHCI_REQ_USE_DMA,4,2          ## @SDHCI_REQ_USE_DMA
	.comm	_SDHCI_TRNS_DMA,4,2             ## @SDHCI_TRNS_DMA
	.comm	_SDHCI_QUIRK2_SUPPORT_SINGLE,4,2 ## @SDHCI_QUIRK2_SUPPORT_SINGLE
	.comm	_SDHCI_TRNS_BLK_CNT_EN,4,2      ## @SDHCI_TRNS_BLK_CNT_EN
	.comm	_CQHCI_CTL,4,2                  ## @CQHCI_CTL
	.comm	_CQHCI_HALT,8,3                 ## @CQHCI_HALT
L_.str.1:                               ## @.str.1
	.asciz	"failed to exit halt state when enable CQE\n"

	.no_dead_strip	_esdhc_cqe_enable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function esdhc_cqe_enable
_esdhc_cqe_enable:                      ; @esdhc_cqe_enable
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
	bl	_mmc_priv
	mov	x20, x0
	ldr	x21, [x19]
Lloh0:
	adrp	x23, _SDHCI_PRESENT_STATE@GOTPAGE
Lloh1:
	ldr	x23, [x23, _SDHCI_PRESENT_STATE@GOTPAGEOFF]
	ldr	w1, [x23]
	bl	_sdhci_readl
Lloh2:
	adrp	x24, _SDHCI_DATA_AVAILABLE@GOTPAGE
Lloh3:
	ldr	x24, [x24, _SDHCI_DATA_AVAILABLE@GOTPAGEOFF]
	ldr	w8, [x24]
	tst	w8, w0
	b.eq	LBB0_5
; %bb.1:
	mov	w25, #-11
Lloh4:
	adrp	x26, _SDHCI_BUFFER@GOTPAGE
Lloh5:
	ldr	x26, [x26, _SDHCI_BUFFER@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x26]
	mov	x0, x20
	bl	_sdhci_readl
	ldr	w1, [x23]
	mov	x0, x20
	bl	_sdhci_readl
	adds	w25, w25, #1
	b.hs	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x22, x0
	mov	w0, #1
	bl	_mdelay
	ldr	w8, [x24]
	tst	w8, w22
	b.ne	LBB0_2
	b	LBB0_5
LBB0_4:
	ldr	w0, [x20, #8]
	bl	_mmc_dev
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
LBB0_5:
Lloh8:
	adrp	x22, _SDHCI_TRANSFER_MODE@GOTPAGE
Lloh9:
	ldr	x22, [x22, _SDHCI_TRANSFER_MODE@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x20
	bl	_sdhci_readw
Lloh10:
	adrp	x8, _SDHCI_REQ_USE_DMA@GOTPAGE
Lloh11:
	ldr	x8, [x8, _SDHCI_REQ_USE_DMA@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	ldp	w9, w10, [x20]
	tst	w8, w9
Lloh13:
	adrp	x8, _SDHCI_TRNS_DMA@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SDHCI_TRNS_DMA@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	csel	w8, wzr, w8, eq
	orr	w8, w8, w0
Lloh16:
	adrp	x9, _SDHCI_QUIRK2_SUPPORT_SINGLE@GOTPAGE
Lloh17:
	ldr	x9, [x9, _SDHCI_QUIRK2_SUPPORT_SINGLE@GOTPAGEOFF]
Lloh18:
	adrp	x11, _SDHCI_TRNS_BLK_CNT_EN@GOTPAGE
Lloh19:
	ldr	x11, [x11, _SDHCI_TRNS_BLK_CNT_EN@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
Lloh21:
	ldr	w11, [x11]
	tst	w9, w10
	csel	w9, w11, wzr, eq
	orr	w1, w8, w9
	ldr	w2, [x22]
	mov	x0, x20
	bl	_sdhci_writew
Lloh22:
	adrp	x22, _CQHCI_CTL@GOTPAGE
Lloh23:
	ldr	x22, [x22, _CQHCI_CTL@GOTPAGEOFF]
	ldr	w2, [x22]
	mov	x0, x21
	mov	w1, #0
	bl	_cqhci_writel
	ldr	w1, [x22]
	mov	x0, x21
	bl	_cqhci_readl
	cbz	x0, LBB0_8
; %bb.6:
Lloh24:
	adrp	x8, _CQHCI_HALT@GOTPAGE
Lloh25:
	ldr	x8, [x8, _CQHCI_HALT@GOTPAGEOFF]
Lloh26:
	ldr	x8, [x8]
	cbz	x8, LBB0_8
; %bb.7:
	ldr	w0, [x20, #8]
	bl	_mmc_dev
Lloh27:
	adrp	x1, l_.str.1@PAGE
Lloh28:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
LBB0_8:
	mov	x0, x19
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_sdhci_cqe_enable
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh20
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_SDHCI_PRESENT_STATE,4,2        ; @SDHCI_PRESENT_STATE
	.comm	_SDHCI_DATA_AVAILABLE,4,2       ; @SDHCI_DATA_AVAILABLE
	.comm	_SDHCI_BUFFER,4,2               ; @SDHCI_BUFFER
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"CQE may get stuck because the Buffer Read Enable bit is set\n"

	.comm	_SDHCI_TRANSFER_MODE,4,2        ; @SDHCI_TRANSFER_MODE
	.comm	_SDHCI_REQ_USE_DMA,4,2          ; @SDHCI_REQ_USE_DMA
	.comm	_SDHCI_TRNS_DMA,4,2             ; @SDHCI_TRNS_DMA
	.comm	_SDHCI_QUIRK2_SUPPORT_SINGLE,4,2 ; @SDHCI_QUIRK2_SUPPORT_SINGLE
	.comm	_SDHCI_TRNS_BLK_CNT_EN,4,2      ; @SDHCI_TRNS_BLK_CNT_EN
	.comm	_CQHCI_CTL,4,2                  ; @CQHCI_CTL
	.comm	_CQHCI_HALT,8,3                 ; @CQHCI_HALT
l_.str.1:                               ; @.str.1
	.asciz	"failed to exit halt state when enable CQE\n"

	.no_dead_strip	_esdhc_cqe_enable
.subsections_via_symbols
