	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dw_mci_get_cd
_dw_mci_get_cd:                         ## @dw_mci_get_cd
	.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	%rdi, %r15
	callq	_mmc_priv
	movq	%rax, %rbx
	movq	8(%rax), %r12
	movq	%r15, %rdi
	callq	_mmc_gpio_get_cd
	movl	%eax, %r14d
	movq	_MMC_CAP_NEEDS_POLL@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	testl	%eax, (%r15)
	je	LBB0_1
LBB0_2:
	movq	_DW_MMC_CARD_PRESENT@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	addq	$4, %rbx
	movq	%rbx, %rsi
	callq	_test_bit
	movl	$1, %r14d
	testl	%eax, %eax
	jne	LBB0_13
## %bb.3:
	movl	(%r13), %eax
	andl	(%r15), %eax
	addq	$4, %r15
	testl	%eax, %eax
	leaq	L_.str.1(%rip), %rax
	leaq	L_.str(%rip), %rsi
	cmoveq	%rax, %rsi
	movq	%r15, %rdi
	callq	_dev_info
	movl	(%r12), %edi
	movq	%rbx, %rsi
	callq	_set_bit
	jmp	LBB0_13
LBB0_1:
	movq	%r15, %rdi
	callq	_mmc_card_is_removable
	testl	%eax, %eax
	je	LBB0_2
## %bb.4:
	testl	%r14d, %r14d
	jns	LBB0_6
## %bb.5:
	movq	8(%rbx), %rdi
	movq	_CDETECT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_mci_readl
	movl	(%rbx), %ecx
	xorl	%r14d, %r14d
	btl	%ecx, %eax
	setae	%r14b
LBB0_6:
	movq	%r12, %rdi
	callq	_spin_lock_bh
	addq	$4, %rbx
	movq	_DW_MMC_CARD_PRESENT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	testl	%r14d, %r14d
	je	LBB0_9
## %bb.7:
	callq	_test_and_set_bit
	testl	%eax, %eax
	jne	LBB0_12
## %bb.8:
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_11
LBB0_9:
	callq	_test_and_clear_bit
	testl	%eax, %eax
	jne	LBB0_12
## %bb.10:
	leaq	L_.str.3(%rip), %rsi
LBB0_11:
	addq	$4, %r15
	movq	%r15, %rdi
	callq	_dev_dbg
LBB0_12:
	movq	%r12, %rdi
	callq	_spin_unlock_bh
LBB0_13:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MMC_CAP_NEEDS_POLL,4,2         ## @MMC_CAP_NEEDS_POLL
	.comm	_DW_MMC_CARD_PRESENT,4,2        ## @DW_MMC_CARD_PRESENT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"card is polling.\n"

L_.str.1:                               ## @.str.1
	.asciz	"card is non-removable.\n"

	.comm	_CDETECT,4,2                    ## @CDETECT
L_.str.2:                               ## @.str.2
	.asciz	"card is present\n"

L_.str.3:                               ## @.str.3
	.asciz	"card is not present\n"

	.no_dead_strip	_dw_mci_get_cd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dw_mci_get_cd
_dw_mci_get_cd:                         ; @dw_mci_get_cd
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, x0
	bl	_mmc_priv
	mov	x22, x0
	ldr	x20, [x0, #8]
	mov	x0, x19
	bl	_mmc_gpio_get_cd
	ldr	w8, [x19]
Lloh0:
	adrp	x23, _MMC_CAP_NEEDS_POLL@GOTPAGE
Lloh1:
	ldr	x23, [x23, _MMC_CAP_NEEDS_POLL@GOTPAGEOFF]
	ldr	w9, [x23]
	tst	w9, w8
	b.eq	LBB0_3
LBB0_1:
Lloh2:
	adrp	x21, _DW_MMC_CARD_PRESENT@GOTPAGE
Lloh3:
	ldr	x21, [x21, _DW_MMC_CARD_PRESENT@GOTPAGEOFF]
	ldr	w0, [x21]
	add	x20, x22, #4
	mov	x1, x20
	bl	_test_bit
	cbz	w0, LBB0_9
; %bb.2:
	mov	w21, #1
	b	LBB0_14
LBB0_3:
	mov	x21, x0
	mov	x0, x19
	bl	_mmc_card_is_removable
	cbz	w0, LBB0_1
; %bb.4:
	tbz	w21, #31, LBB0_6
; %bb.5:
	ldr	x0, [x22, #8]
Lloh4:
	adrp	x8, _CDETECT@GOTPAGE
Lloh5:
	ldr	x8, [x8, _CDETECT@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	bl	_mci_readl
	ldr	w8, [x22]
	mvn	w9, w0
	lsr	w8, w9, w8
	and	w21, w8, #0x1
LBB0_6:
	mov	x0, x20
	bl	_spin_lock_bh
Lloh7:
	adrp	x8, _DW_MMC_CARD_PRESENT@GOTPAGE
Lloh8:
	ldr	x8, [x8, _DW_MMC_CARD_PRESENT@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	add	x1, x22, #4
	cbz	w21, LBB0_10
; %bb.7:
	bl	_test_and_set_bit
	cbnz	w0, LBB0_13
; %bb.8:
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_12
LBB0_9:
	ldr	w8, [x19], #4
	ldr	w9, [x23]
Lloh12:
	adrp	x10, l_.str@PAGE
Lloh13:
	add	x10, x10, l_.str@PAGEOFF
Lloh14:
	adrp	x11, l_.str.1@PAGE
Lloh15:
	add	x11, x11, l_.str.1@PAGEOFF
	tst	w9, w8
	csel	x1, x11, x10, eq
	mov	x0, x19
	bl	_dev_info
	ldr	w0, [x21]
	mov	x1, x20
	bl	_set_bit
	mov	w21, #1
	b	LBB0_14
LBB0_10:
	bl	_test_and_clear_bit
	cbnz	w0, LBB0_13
; %bb.11:
Lloh16:
	adrp	x1, l_.str.3@PAGE
Lloh17:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_12:
	add	x0, x19, #4
	bl	_dev_dbg
LBB0_13:
	mov	x0, x20
	bl	_spin_unlock_bh
LBB0_14:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_MMC_CAP_NEEDS_POLL,4,2         ; @MMC_CAP_NEEDS_POLL
	.comm	_DW_MMC_CARD_PRESENT,4,2        ; @DW_MMC_CARD_PRESENT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"card is polling.\n"

l_.str.1:                               ; @.str.1
	.asciz	"card is non-removable.\n"

	.comm	_CDETECT,4,2                    ; @CDETECT
l_.str.2:                               ; @.str.2
	.asciz	"card is present\n"

l_.str.3:                               ; @.str.3
	.asciz	"card is not present\n"

	.no_dead_strip	_dw_mci_get_cd
.subsections_via_symbols
