	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sdhci_finish_command
_sdhci_finish_command:                  ## @sdhci_finish_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movq	40(%rdi), %rbx
	movq	$0, 40(%rdi)
	movl	(%rbx), %eax
	movq	_MMC_RSP_PRESENT@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_4
## %bb.1:
	movq	_MMC_RSP_136@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_3
## %bb.2:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_sdhci_read_rsp_136
	jmp	LBB0_4
LBB0_3:
	movq	_SDHCI_RESPONSE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_sdhci_readl
	movq	24(%rbx), %rcx
	movl	%eax, (%rcx)
LBB0_4:
	movq	8(%rbx), %rsi
	cmpq	$0, 16(%rsi)
	je	LBB0_7
## %bb.5:
	cmpq	(%rsi), %rbx
	jne	LBB0_7
## %bb.6:
	movl	32(%r14), %edi
	callq	_mmc_command_done
LBB0_7:
	movq	_MMC_RSP_BUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_12
## %bb.8:
	cmpq	$0, 16(%rbx)
	je	LBB0_10
## %bb.9:
	leaq	L_.str(%rip), %rdi
	callq	_DBG
	jmp	LBB0_12
LBB0_10:
	movq	_SDHCI_QUIRK_NO_BUSY_IRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	jne	LBB0_12
## %bb.11:
	cmpq	24(%r14), %rbx
	je	LBB0_17
LBB0_12:
	movq	8(%rbx), %rax
	cmpq	8(%rax), %rbx
	je	LBB0_18
## %bb.13:
	cmpq	$0, 16(%r14)
	je	LBB0_16
## %bb.14:
	cmpq	$0, 8(%r14)
	je	LBB0_16
## %bb.15:
	movq	%r14, %rdi
	callq	_sdhci_finish_data
LBB0_16:
	cmpq	$0, 16(%rbx)
	je	LBB0_19
LBB0_17:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_18:
	movq	(%rax), %rsi
	movq	%r14, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_sdhci_send_command             ## TAILCALL
LBB0_19:
	movq	8(%rbx), %rsi
	movq	%r14, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	___sdhci_finish_mrq             ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MMC_RSP_PRESENT,4,2            ## @MMC_RSP_PRESENT
	.comm	_MMC_RSP_136,4,2                ## @MMC_RSP_136
	.comm	_SDHCI_RESPONSE,4,2             ## @SDHCI_RESPONSE
	.comm	_MMC_RSP_BUSY,4,2               ## @MMC_RSP_BUSY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot wait for busy signal when also doing a data transfer"

	.comm	_SDHCI_QUIRK_NO_BUSY_IRQ,4,2    ## @SDHCI_QUIRK_NO_BUSY_IRQ
	.no_dead_strip	_sdhci_finish_command
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sdhci_finish_command
_sdhci_finish_command:                  ; @sdhci_finish_command
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x20, [x0, #40]
	str	xzr, [x0, #40]
	ldr	w8, [x20]
Lloh0:
	adrp	x9, _MMC_RSP_PRESENT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MMC_RSP_PRESENT@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.1:
Lloh3:
	adrp	x9, _MMC_RSP_136@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MMC_RSP_136@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.2:
	mov	x0, x19
	mov	x1, x20
	bl	_sdhci_read_rsp_136
	b	LBB0_4
LBB0_3:
Lloh6:
	adrp	x8, _SDHCI_RESPONSE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SDHCI_RESPONSE@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_sdhci_readl
	ldr	x8, [x20, #24]
	str	w0, [x8]
LBB0_4:
	ldr	x1, [x20, #8]
	ldr	x8, [x1, #16]
	cbz	x8, LBB0_7
; %bb.5:
	ldr	x8, [x1]
	cmp	x20, x8
	b.ne	LBB0_7
; %bb.6:
	ldr	w0, [x19, #32]
	bl	_mmc_command_done
LBB0_7:
	ldr	w8, [x20]
Lloh9:
	adrp	x9, _MMC_RSP_BUSY@GOTPAGE
Lloh10:
	ldr	x9, [x9, _MMC_RSP_BUSY@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_12
; %bb.8:
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_10
; %bb.9:
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DBG
	b	LBB0_12
LBB0_10:
	ldr	w8, [x19]
Lloh14:
	adrp	x9, _SDHCI_QUIRK_NO_BUSY_IRQ@GOTPAGE
Lloh15:
	ldr	x9, [x9, _SDHCI_QUIRK_NO_BUSY_IRQ@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_12
; %bb.11:
	ldr	x8, [x19, #24]
	cmp	x20, x8
	b.eq	LBB0_17
LBB0_12:
	ldr	x8, [x20, #8]
	ldr	x9, [x8, #8]
	cmp	x20, x9
	b.eq	LBB0_18
; %bb.13:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_16
; %bb.14:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_16
; %bb.15:
	mov	x0, x19
	bl	_sdhci_finish_data
LBB0_16:
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_19
LBB0_17:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_18:
	ldr	x1, [x8]
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_sdhci_send_command
LBB0_19:
	ldr	x1, [x20, #8]
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	___sdhci_finish_mrq
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_MMC_RSP_PRESENT,4,2            ; @MMC_RSP_PRESENT
	.comm	_MMC_RSP_136,4,2                ; @MMC_RSP_136
	.comm	_SDHCI_RESPONSE,4,2             ; @SDHCI_RESPONSE
	.comm	_MMC_RSP_BUSY,4,2               ; @MMC_RSP_BUSY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot wait for busy signal when also doing a data transfer"

	.comm	_SDHCI_QUIRK_NO_BUSY_IRQ,4,2    ; @SDHCI_QUIRK_NO_BUSY_IRQ
	.no_dead_strip	_sdhci_finish_command
.subsections_via_symbols
