	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function usdhi6_end_cmd
_usdhi6_end_cmd:                        ## @usdhi6_end_cmd
	.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	%rdi, %r12
	movq	24(%rdi), %rbx
	movq	16(%rbx), %r15
	cmpq	$0, 16(%rdi)
	je	LBB0_2
## %bb.1:
	movq	%r12, %rdi
	callq	_usdhi6_error_code
	movl	%eax, 8(%r15)
	xorl	%r14d, %r14d
	jmp	LBB0_18
LBB0_2:
	movq	%r12, %rdi
	callq	_usdhi6_resp_read
	movq	(%rbx), %rcx
	xorl	%r14d, %r14d
	testq	%rcx, %rcx
	je	LBB0_18
## %bb.3:
	cmpq	$0, 8(%r12)
	je	LBB0_7
## %bb.4:
	movq	%r12, %rdi
	callq	_usdhi6_dma_kick
	cmpl	$0, 8(%rbx)
	je	LBB0_5
## %bb.6:
	movq	%r12, %rdi
	callq	_usdhi6_stop_cmd
	testq	%rax, %rax
	jns	LBB0_17
	jmp	LBB0_18
LBB0_7:
	movq	_MMC_DATA_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	(%r15), %rdx
	testl	%eax, (%rcx)
	je	LBB0_12
## %bb.8:
	movq	_MMC_READ_MULTIPLE_BLOCK@GOTPCREL(%rip), %rsi
	movq	_USDHI6_WAIT_FOR_MREAD@GOTPCREL(%rip), %rax
	cmpq	(%rsi), %rdx
	je	LBB0_16
## %bb.9:
	movq	_SD_IO_RW_EXTENDED@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rdx
	jne	LBB0_11
## %bb.10:
	cmpl	$1, 4(%rcx)
	jg	LBB0_16
LBB0_11:
	movq	_USDHI6_WAIT_FOR_READ@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_5:
	movq	_USDHI6_WAIT_FOR_DMA@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_12:
	movq	_MMC_WRITE_MULTIPLE_BLOCK@GOTPCREL(%rip), %rsi
	movq	_USDHI6_WAIT_FOR_MWRITE@GOTPCREL(%rip), %rax
	cmpq	(%rsi), %rdx
	je	LBB0_16
## %bb.13:
	movq	_SD_IO_RW_EXTENDED@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rdx
	jne	LBB0_15
## %bb.14:
	cmpl	$1, 4(%rcx)
	jg	LBB0_16
LBB0_15:
	movq	_USDHI6_WAIT_FOR_WRITE@GOTPCREL(%rip), %rax
LBB0_16:
	movl	(%rax), %eax
	movl	%eax, (%r12)
LBB0_17:
	movl	$1, %r14d
LBB0_18:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_USDHI6_WAIT_FOR_DMA,4,2        ## @USDHI6_WAIT_FOR_DMA
	.comm	_MMC_DATA_READ,4,2              ## @MMC_DATA_READ
	.comm	_MMC_READ_MULTIPLE_BLOCK,8,3    ## @MMC_READ_MULTIPLE_BLOCK
	.comm	_SD_IO_RW_EXTENDED,8,3          ## @SD_IO_RW_EXTENDED
	.comm	_USDHI6_WAIT_FOR_MREAD,4,2      ## @USDHI6_WAIT_FOR_MREAD
	.comm	_USDHI6_WAIT_FOR_READ,4,2       ## @USDHI6_WAIT_FOR_READ
	.comm	_MMC_WRITE_MULTIPLE_BLOCK,8,3   ## @MMC_WRITE_MULTIPLE_BLOCK
	.comm	_USDHI6_WAIT_FOR_MWRITE,4,2     ## @USDHI6_WAIT_FOR_MWRITE
	.comm	_USDHI6_WAIT_FOR_WRITE,4,2      ## @USDHI6_WAIT_FOR_WRITE
	.no_dead_strip	_usdhi6_end_cmd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function usdhi6_end_cmd
_usdhi6_end_cmd:                        ; @usdhi6_end_cmd
	.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	x19, x0
	ldp	x8, x21, [x0, #16]
	ldr	x20, [x21, #16]
	cbz	x8, LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_usdhi6_error_code
	mov	x8, x0
	mov	w0, #0
	str	w8, [x20, #8]
	b	LBB0_21
LBB0_2:
	mov	x0, x19
	bl	_usdhi6_resp_read
	ldr	x8, [x21]
	cbz	x8, LBB0_6
; %bb.3:
	ldr	x9, [x19, #8]
	cbz	x9, LBB0_7
; %bb.4:
	mov	x0, x19
	bl	_usdhi6_dma_kick
	ldr	w8, [x21, #8]
	cbz	w8, LBB0_12
; %bb.5:
	mov	x0, x19
	bl	_usdhi6_stop_cmd
	tbz	x0, #63, LBB0_20
LBB0_6:
	mov	w0, #0
	b	LBB0_21
LBB0_7:
	ldr	w10, [x8]
Lloh0:
	adrp	x9, _MMC_DATA_READ@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MMC_DATA_READ@GOTPAGEOFF]
Lloh2:
	ldr	w11, [x9]
	ldr	x9, [x20]
	tst	w11, w10
	b.eq	LBB0_13
; %bb.8:
Lloh3:
	adrp	x10, _MMC_READ_MULTIPLE_BLOCK@GOTPAGE
Lloh4:
	ldr	x10, [x10, _MMC_READ_MULTIPLE_BLOCK@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
	cmp	x9, x10
	b.eq	LBB0_11
; %bb.9:
Lloh6:
	adrp	x10, _SD_IO_RW_EXTENDED@GOTPAGE
Lloh7:
	ldr	x10, [x10, _SD_IO_RW_EXTENDED@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_15
; %bb.10:
	ldr	w8, [x8, #4]
	cmp	w8, #1
	b.le	LBB0_15
LBB0_11:
Lloh9:
	adrp	x8, _USDHI6_WAIT_FOR_MREAD@GOTPAGE
Lloh10:
	ldr	x8, [x8, _USDHI6_WAIT_FOR_MREAD@GOTPAGEOFF]
	b	LBB0_19
LBB0_12:
Lloh11:
	adrp	x8, _USDHI6_WAIT_FOR_DMA@GOTPAGE
Lloh12:
	ldr	x8, [x8, _USDHI6_WAIT_FOR_DMA@GOTPAGEOFF]
	b	LBB0_19
LBB0_13:
Lloh13:
	adrp	x10, _MMC_WRITE_MULTIPLE_BLOCK@GOTPAGE
Lloh14:
	ldr	x10, [x10, _MMC_WRITE_MULTIPLE_BLOCK@GOTPAGEOFF]
Lloh15:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_16
LBB0_14:
Lloh16:
	adrp	x8, _USDHI6_WAIT_FOR_MWRITE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _USDHI6_WAIT_FOR_MWRITE@GOTPAGEOFF]
	b	LBB0_19
LBB0_15:
Lloh18:
	adrp	x8, _USDHI6_WAIT_FOR_READ@GOTPAGE
Lloh19:
	ldr	x8, [x8, _USDHI6_WAIT_FOR_READ@GOTPAGEOFF]
	b	LBB0_19
LBB0_16:
Lloh20:
	adrp	x10, _SD_IO_RW_EXTENDED@GOTPAGE
Lloh21:
	ldr	x10, [x10, _SD_IO_RW_EXTENDED@GOTPAGEOFF]
Lloh22:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_18
; %bb.17:
	ldr	w8, [x8, #4]
	cmp	w8, #1
	b.gt	LBB0_14
LBB0_18:
Lloh23:
	adrp	x8, _USDHI6_WAIT_FOR_WRITE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _USDHI6_WAIT_FOR_WRITE@GOTPAGEOFF]
LBB0_19:
	ldr	w8, [x8]
	str	w8, [x19]
LBB0_20:
	mov	w0, #1
LBB0_21:
	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
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_USDHI6_WAIT_FOR_DMA,4,2        ; @USDHI6_WAIT_FOR_DMA
	.comm	_MMC_DATA_READ,4,2              ; @MMC_DATA_READ
	.comm	_MMC_READ_MULTIPLE_BLOCK,8,3    ; @MMC_READ_MULTIPLE_BLOCK
	.comm	_SD_IO_RW_EXTENDED,8,3          ; @SD_IO_RW_EXTENDED
	.comm	_USDHI6_WAIT_FOR_MREAD,4,2      ; @USDHI6_WAIT_FOR_MREAD
	.comm	_USDHI6_WAIT_FOR_READ,4,2       ; @USDHI6_WAIT_FOR_READ
	.comm	_MMC_WRITE_MULTIPLE_BLOCK,8,3   ; @MMC_WRITE_MULTIPLE_BLOCK
	.comm	_USDHI6_WAIT_FOR_MWRITE,4,2     ; @USDHI6_WAIT_FOR_MWRITE
	.comm	_USDHI6_WAIT_FOR_WRITE,4,2      ; @USDHI6_WAIT_FOR_WRITE
	.no_dead_strip	_usdhi6_end_cmd
.subsections_via_symbols
