	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pxamci_data_done
_pxamci_data_done:                      ## @pxamci_data_done
	.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
	movq	16(%rdi), %rbx
	testq	%rbx, %rbx
	je	LBB0_1
## %bb.2:
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	_MMC_DATA_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%ecx, %ecx
	andl	(%rbx), %eax
	setne	%cl
	movq	32(%rdi,%rcx,8), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	movl	20(%rbx), %edx
	movl	24(%rbx), %esi
	movl	24(%r15), %ecx
	callq	_dma_unmap_sg
	movq	_STAT_READ_TIME_OUT@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_4
## %bb.3:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rcx
	jmp	LBB0_7
LBB0_1:
	xorl	%eax, %eax
	jmp	LBB0_14
LBB0_4:
	movq	_STAT_CRC_READ_ERROR@GOTPCREL(%rip), %rax
	movq	_STAT_CRC_WRITE_ERROR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	testl	%r14d, %ecx
	je	LBB0_5
## %bb.6:
	movq	_EILSEQ@GOTPCREL(%rip), %rcx
LBB0_7:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	movl	%eax, 16(%rbx)
LBB0_8:
	xorl	%ecx, %ecx
	testl	%eax, %eax
	jne	LBB0_10
## %bb.9:
	movl	12(%rbx), %ecx
	imull	8(%rbx), %ecx
LBB0_10:
	movl	%ecx, 4(%rbx)
	movq	_DATA_TRAN_DONE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_pxamci_disable_irq
	movq	$0, 16(%r15)
	movq	(%r15), %rsi
	cmpq	$0, (%rsi)
	je	LBB0_12
## %bb.11:
	movq	%r15, %rdi
	callq	_pxamci_stop_clock
	movq	(%r15), %rax
	movq	(%rax), %rsi
	movl	8(%r15), %edx
	movq	%r15, %rdi
	callq	_pxamci_start_cmd
	jmp	LBB0_13
LBB0_12:
	movq	%r15, %rdi
	callq	_pxamci_finish_request
LBB0_13:
	movl	$1, %eax
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	16(%rbx), %eax
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_MMC_DATA_READ,4,2              ## @MMC_DATA_READ
	.comm	_STAT_READ_TIME_OUT,4,2         ## @STAT_READ_TIME_OUT
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_STAT_CRC_READ_ERROR,4,2        ## @STAT_CRC_READ_ERROR
	.comm	_STAT_CRC_WRITE_ERROR,4,2       ## @STAT_CRC_WRITE_ERROR
	.comm	_EILSEQ,4,2                     ## @EILSEQ
	.comm	_DATA_TRAN_DONE,4,2             ## @DATA_TRAN_DONE
	.no_dead_strip	_pxamci_data_done
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pxamci_data_done
_pxamci_data_done:                      ; @pxamci_data_done
	.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
	ldr	x21, [x0, #16]
	cbz	x21, LBB0_3
; %bb.1:
	mov	x20, x1
	mov	x19, x0
	ldr	w8, [x21]
Lloh0:
	adrp	x9, _MMC_DATA_READ@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MMC_DATA_READ@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	mov	w8, #40
	mov	w9, #32
	csel	x8, x9, x8, eq
	ldr	x8, [x0, x8]
	ldr	x8, [x8]
	ldr	w0, [x8]
	ldp	w2, w1, [x21, #20]
	ldr	w3, [x19, #24]
	bl	_dma_unmap_sg
Lloh3:
	adrp	x8, _STAT_READ_TIME_OUT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _STAT_READ_TIME_OUT@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_4
; %bb.2:
Lloh6:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
	b	LBB0_6
LBB0_3:
	mov	w0, #0
	b	LBB0_14
LBB0_4:
Lloh8:
	adrp	x8, _STAT_CRC_READ_ERROR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _STAT_CRC_READ_ERROR@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	adrp	x9, _STAT_CRC_WRITE_ERROR@GOTPAGE
Lloh12:
	ldr	x9, [x9, _STAT_CRC_WRITE_ERROR@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	orr	w8, w9, w8
	tst	w8, w20
	b.eq	LBB0_8
; %bb.5:
Lloh14:
	adrp	x8, _EILSEQ@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EILSEQ@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w8, w8
	str	w8, [x21, #16]
	cbz	w8, LBB0_9
LBB0_7:
	mov	w8, #0
	b	LBB0_10
LBB0_8:
	ldr	w8, [x21, #16]
	cbnz	w8, LBB0_7
LBB0_9:
	ldp	w8, w9, [x21, #8]
	mul	w8, w9, w8
LBB0_10:
	str	w8, [x21, #4]
Lloh16:
	adrp	x8, _DATA_TRAN_DONE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _DATA_TRAN_DONE@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_pxamci_disable_irq
	str	xzr, [x19, #16]
	ldr	x1, [x19]
	ldr	x8, [x1]
	cbz	x8, LBB0_12
; %bb.11:
	mov	x0, x19
	bl	_pxamci_stop_clock
	ldr	x8, [x19]
	ldr	x1, [x8]
	ldr	w2, [x19, #8]
	mov	x0, x19
	bl	_pxamci_start_cmd
	b	LBB0_13
LBB0_12:
	mov	x0, x19
	bl	_pxamci_finish_request
LBB0_13:
	mov	w0, #1
LBB0_14:
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_MMC_DATA_READ,4,2              ; @MMC_DATA_READ
	.comm	_STAT_READ_TIME_OUT,4,2         ; @STAT_READ_TIME_OUT
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_STAT_CRC_READ_ERROR,4,2        ; @STAT_CRC_READ_ERROR
	.comm	_STAT_CRC_WRITE_ERROR,4,2       ; @STAT_CRC_WRITE_ERROR
	.comm	_EILSEQ,4,2                     ; @EILSEQ
	.comm	_DATA_TRAN_DONE,4,2             ; @DATA_TRAN_DONE
	.no_dead_strip	_pxamci_data_done
.subsections_via_symbols
