	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function imxmci_finish_data
_imxmci_finish_data:                    ## @imxmci_finish_data
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	(%rdi), %r15
	movq	_IMXMCI_PEND_DMA_DATA_b@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	28(%rbx), %rsi
	callq	_test_and_clear_bit
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movl	24(%rbx), %edi
	callq	_imx_dma_disable
	movl	12(%rbx), %edi
	callq	_mmc_dev
	movl	8(%r15), %esi
	movl	16(%rbx), %ecx
	movl	20(%rbx), %edx
	movl	%eax, %edi
	callq	_dma_unmap_sg
LBB0_2:
	movq	_STATUS_ERR_MASK@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_9
## %bb.3:
	movl	12(%rbx), %edi
	callq	_mmc_dev
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	movl	%r14d, %edx
	callq	_dev_dbg
	movq	_STATUS_CRC_READ_ERR@GOTPCREL(%rip), %rax
	movq	_STATUS_CRC_WRITE_ERR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	testl	%r14d, %ecx
	je	LBB0_6
## %bb.4:
	movq	_EILSEQ@GOTPCREL(%rip), %rcx
	jmp	LBB0_5
LBB0_9:
	movl	8(%rbx), %eax
	movl	%eax, 4(%r15)
	movl	(%r15), %eax
	jmp	LBB0_10
LBB0_6:
	movq	_STATUS_TIME_OUT_READ@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_8
## %bb.7:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rcx
	jmp	LBB0_5
LBB0_8:
	movq	_EIO@GOTPCREL(%rip), %rcx
LBB0_5:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	movl	%eax, (%r15)
LBB0_10:
	movq	$0, (%rbx)
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IMXMCI_PEND_DMA_DATA_b,4,2     ## @IMXMCI_PEND_DMA_DATA_b
	.comm	_STATUS_ERR_MASK,4,2            ## @STATUS_ERR_MASK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"request failed. status: 0x%08x\n"

	.comm	_STATUS_CRC_READ_ERR,4,2        ## @STATUS_CRC_READ_ERR
	.comm	_STATUS_CRC_WRITE_ERR,4,2       ## @STATUS_CRC_WRITE_ERR
	.comm	_EILSEQ,4,2                     ## @EILSEQ
	.comm	_STATUS_TIME_OUT_READ,4,2       ## @STATUS_TIME_OUT_READ
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_imxmci_finish_data
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function imxmci_finish_data
_imxmci_finish_data:                    ; @imxmci_finish_data
	.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	x20, x1
	mov	x19, x0
	mov	x1, x0
	ldr	x21, [x1], #28
Lloh0:
	adrp	x8, _IMXMCI_PEND_DMA_DATA_b@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IMXMCI_PEND_DMA_DATA_b@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_test_and_clear_bit
	cbz	x0, LBB0_2
; %bb.1:
	ldr	w0, [x19, #24]
	bl	_imx_dma_disable
	ldr	w0, [x19, #12]
	bl	_mmc_dev
	ldr	w1, [x21, #8]
	ldp	w3, w2, [x19, #16]
	bl	_dma_unmap_sg
LBB0_2:
Lloh3:
	adrp	x8, _STATUS_ERR_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _STATUS_ERR_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_5
; %bb.3:
	ldr	w0, [x19, #12]
	bl	_mmc_dev
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_dev_dbg
Lloh8:
	adrp	x8, _STATUS_CRC_READ_ERR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _STATUS_CRC_READ_ERR@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	adrp	x9, _STATUS_CRC_WRITE_ERR@GOTPAGE
Lloh12:
	ldr	x9, [x9, _STATUS_CRC_WRITE_ERR@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	orr	w8, w9, w8
	tst	w8, w20
	b.eq	LBB0_6
; %bb.4:
Lloh14:
	adrp	x8, _EILSEQ@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EILSEQ@GOTPAGEOFF]
	b	LBB0_9
LBB0_5:
	ldr	w8, [x19, #8]
	str	w8, [x21, #4]
	ldr	w0, [x21]
	b	LBB0_10
LBB0_6:
Lloh16:
	adrp	x8, _STATUS_TIME_OUT_READ@GOTPAGE
Lloh17:
	ldr	x8, [x8, _STATUS_TIME_OUT_READ@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_8
; %bb.7:
Lloh19:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:
Lloh21:
	adrp	x8, _EIO@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w0, w8
	str	w0, [x21]
LBB0_10:
	str	xzr, [x19]
	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	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_IMXMCI_PEND_DMA_DATA_b,4,2     ; @IMXMCI_PEND_DMA_DATA_b
	.comm	_STATUS_ERR_MASK,4,2            ; @STATUS_ERR_MASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"request failed. status: 0x%08x\n"

	.comm	_STATUS_CRC_READ_ERR,4,2        ; @STATUS_CRC_READ_ERR
	.comm	_STATUS_CRC_WRITE_ERR,4,2       ; @STATUS_CRC_WRITE_ERR
	.comm	_EILSEQ,4,2                     ; @EILSEQ
	.comm	_STATUS_TIME_OUT_READ,4,2       ; @STATUS_TIME_OUT_READ
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_imxmci_finish_data
.subsections_via_symbols
