	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mmc_blk_card_busy
_mmc_blk_card_busy:                     ## @mmc_blk_card_busy
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	%rsi, %rdi
	callq	_req_to_mmc_queue_req
	movq	%rax, %r14
	movl	$0, -36(%rbp)
	movl	(%r15), %edi
	callq	_mmc_host_is_spi
	xorl	%r12d, %r12d
	testq	%rax, %rax
	jne	LBB0_7
## %bb.1:
	movq	%rbx, %rdi
	callq	_rq_data_dir
	movq	_READ@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_7
## %bb.2:
	movq	_MMC_BLK_TIMEOUT_MS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-36(%rbp), %rcx
	movq	%r15, %rdi
	movq	%rbx, %rdx
	callq	_card_busy_detect
	movl	%eax, %r12d
	movl	-36(%rbp), %ebx
	movq	%r14, %rdi
	callq	_mmc_blk_stop_err_bits
	testl	%ebx, %eax
	je	LBB0_4
## %bb.3:
	movq	$0, 8(%r14)
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	testl	%r12d, %r12d
	cmovel	%ecx, %r12d
LBB0_4:
	movq	%r15, %rdi
	callq	_mmc_card_mmc
	testq	%rax, %rax
	je	LBB0_7
## %bb.5:
	movq	_R1_EXCEPTION_EVENT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -36(%rbp)
	je	LBB0_7
## %bb.6:
	movq	(%r14), %rcx
	orl	%eax, (%rcx)
LBB0_7:
	movl	%r12d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_READ,8,3                       ## @READ
	.comm	_MMC_BLK_TIMEOUT_MS,4,2         ## @MMC_BLK_TIMEOUT_MS
	.comm	_EIO,4,2                        ## @EIO
	.comm	_R1_EXCEPTION_EVENT,4,2         ## @R1_EXCEPTION_EVENT
	.no_dead_strip	_mmc_blk_card_busy
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mmc_blk_card_busy
_mmc_blk_card_busy:                     ; @mmc_blk_card_busy
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x22, x1
	mov	x20, x0
	mov	x0, x1
	bl	_req_to_mmc_queue_req
	mov	x19, x0
	str	wzr, [sp, #12]
	ldr	w0, [x20]
	bl	_mmc_host_is_spi
	mov	w21, #0
	cbnz	x0, LBB0_8
; %bb.1:
	mov	x0, x22
	bl	_rq_data_dir
Lloh0:
	adrp	x8, _READ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _READ@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_3
; %bb.2:
	mov	w21, #0
	b	LBB0_8
LBB0_3:
Lloh3:
	adrp	x8, _MMC_BLK_TIMEOUT_MS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MMC_BLK_TIMEOUT_MS@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	add	x3, sp, #12
	mov	x0, x20
	mov	x2, x22
	bl	_card_busy_detect
	mov	x21, x0
	ldr	w22, [sp, #12]
	mov	x0, x19
	bl	_mmc_blk_stop_err_bits
	tst	w0, w22
	b.eq	LBB0_5
; %bb.4:
	str	xzr, [x19, #8]
Lloh6:
	adrp	x8, _EIO@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w21, #0
	csneg	w21, w21, w8, ne
LBB0_5:
	mov	x0, x20
	bl	_mmc_card_mmc
	cbz	x0, LBB0_8
; %bb.6:
	ldr	w9, [sp, #12]
Lloh9:
	adrp	x8, _R1_EXCEPTION_EVENT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _R1_EXCEPTION_EVENT@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	tst	w8, w9
	b.eq	LBB0_8
; %bb.7:
	ldr	x9, [x19]
	ldr	w10, [x9]
	orr	w8, w10, w8
	str	w8, [x9]
LBB0_8:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_READ,8,3                       ; @READ
	.comm	_MMC_BLK_TIMEOUT_MS,4,2         ; @MMC_BLK_TIMEOUT_MS
	.comm	_EIO,4,2                        ; @EIO
	.comm	_R1_EXCEPTION_EVENT,4,2         ; @R1_EXCEPTION_EVENT
	.no_dead_strip	_mmc_blk_card_busy
.subsections_via_symbols
