	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atmci_prepare_data_pdc
_atmci_prepare_data_pdc:                ## @atmci_prepare_data_pdc
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r12
	movq	_EINPROGRESS@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	movl	%ecx, 20(%rsi)
	movq	%rsi, 32(%rdi)
	movl	16(%rsi), %eax
	movl	%eax, 48(%rdi)
	movq	_ATMCI_DATA_ERROR_FLAGS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_ATMCI_MR@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	_ATMCI_MR_PDCMODE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	orl	(%rdi), %edx
	callq	_atmci_writel
	movl	(%r14), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_MMC_DATA_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -72(%rbp)                 ## 4-byte Spill
	movq	_ATMCI_ENDTX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movq	_ATMCI_TXBUFE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	movq	_ATMCI_RXBUFF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	movq	_ATMCI_BLKE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	_ATMCI_ENDRX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movl	(%r15), %esi
	movq	%r12, %rdi
	callq	_atmci_readl
	movzwl	%ax, %ebx
	movl	4(%r14), %edi
	callq	_ATMCI_BLKLEN
	orl	%eax, %ebx
	movl	(%r15), %esi
	movq	%r12, %rdi
	movl	%ebx, %edx
	callq	_atmci_writel
	movl	4(%r14), %eax
	imull	8(%r14), %eax
	movl	%eax, 4(%r12)
	movq	40(%r12), %rbx
	movl	12(%r14), %r13d
	movl	16(%r14), %r15d
	movq	%r14, %rdi
	callq	_mmc_get_dma_dir
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movl	%r13d, %edx
	movl	%eax, %ecx
	callq	_dma_map_sg
	cmpl	$0, 24(%r12)
	je	LBB0_1
LBB0_6:
	movl	4(%r12), %eax
	movl	-48(%rbp), %r15d                ## 4-byte Reload
	movl	-44(%rbp), %r13d                ## 4-byte Reload
LBB0_7:
	testl	%eax, %eax
	je	LBB0_12
## %bb.8:
	movq	_MMC_DATA_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	(%r14), %eax
	jne	LBB0_9
## %bb.10:
	movq	_XFER_TRANSMIT@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_1:
	movq	32(%r12), %rax
	movq	_MMC_DATA_WRITE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_6
## %bb.2:
	movl	12(%rax), %esi
	movl	16(%rax), %edi
	movq	8(%r12), %rdx
	movl	4(%r12), %ecx
	callq	_sg_copy_to_buffer
	cmpq	$0, 16(%r12)
	je	LBB0_6
## %bb.3:
	movl	4(%r12), %eax
	testl	%eax, %eax
	movl	-48(%rbp), %r15d                ## 4-byte Reload
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	jle	LBB0_7
## %bb.4:
	movq	8(%r12), %rcx
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rcx,%rbx,4), %edi
	callq	_swab32
	movq	8(%r12), %rcx
	movl	%eax, (%rcx,%rbx,4)
	incq	%rbx
	movslq	4(%r12), %rax
	cmpq	%rax, %rbx
	jl	LBB0_5
	jmp	LBB0_7
LBB0_9:
	movq	_XFER_RECEIVE@GOTPCREL(%rip), %rax
LBB0_11:
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_atmci_pdc_set_both_buf
LBB0_12:
	movl	-64(%rbp), %ecx                 ## 4-byte Reload
	orl	-60(%rbp), %ecx                 ## 4-byte Folded Reload
	orl	-56(%rbp), %ecx                 ## 4-byte Folded Reload
	movl	-68(%rbp), %eax                 ## 4-byte Reload
	orl	-52(%rbp), %eax                 ## 4-byte Folded Reload
	testl	%r13d, -72(%rbp)                ## 4-byte Folded Reload
	cmovel	%ecx, %eax
	orl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINPROGRESS,4,2                ## @EINPROGRESS
	.comm	_ATMCI_DATA_ERROR_FLAGS,4,2     ## @ATMCI_DATA_ERROR_FLAGS
	.comm	_ATMCI_MR,4,2                   ## @ATMCI_MR
	.comm	_ATMCI_MR_PDCMODE,4,2           ## @ATMCI_MR_PDCMODE
	.comm	_MMC_DATA_READ,4,2              ## @MMC_DATA_READ
	.comm	_ATMCI_ENDRX,4,2                ## @ATMCI_ENDRX
	.comm	_ATMCI_RXBUFF,4,2               ## @ATMCI_RXBUFF
	.comm	_ATMCI_ENDTX,4,2                ## @ATMCI_ENDTX
	.comm	_ATMCI_TXBUFE,4,2               ## @ATMCI_TXBUFE
	.comm	_ATMCI_BLKE,4,2                 ## @ATMCI_BLKE
	.comm	_MMC_DATA_WRITE,4,2             ## @MMC_DATA_WRITE
	.comm	_XFER_RECEIVE,4,2               ## @XFER_RECEIVE
	.comm	_XFER_TRANSMIT,4,2              ## @XFER_TRANSMIT
	.no_dead_strip	_atmci_prepare_data_pdc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atmci_prepare_data_pdc
_atmci_prepare_data_pdc:                ; @atmci_prepare_data_pdc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _EINPROGRESS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINPROGRESS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w8, w8
	str	w8, [x1, #20]
	str	x1, [x0, #32]
	ldr	w8, [x1, #16]
	str	w8, [x0, #48]
Lloh3:
	adrp	x8, _ATMCI_DATA_ERROR_FLAGS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ATMCI_DATA_ERROR_FLAGS@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [sp, #12]                   ; 4-byte Folded Spill
Lloh6:
	adrp	x21, _ATMCI_MR@GOTPAGE
Lloh7:
	ldr	x21, [x21, _ATMCI_MR@GOTPAGEOFF]
	ldr	w1, [x21]
	ldr	w8, [x0]
Lloh8:
	adrp	x9, _ATMCI_MR_PDCMODE@GOTPAGE
Lloh9:
	ldr	x9, [x9, _ATMCI_MR_PDCMODE@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w2, w9, w8
	bl	_atmci_writel
Lloh11:
	adrp	x9, _MMC_DATA_READ@GOTPAGE
Lloh12:
	ldr	x9, [x9, _MMC_DATA_READ@GOTPAGEOFF]
	ldr	w10, [x20]
Lloh13:
	ldr	w8, [x9]
	stp	w8, w10, [sp, #4]               ; 8-byte Folded Spill
Lloh14:
	adrp	x8, _ATMCI_ENDTX@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ATMCI_ENDTX@GOTPAGEOFF]
Lloh16:
	adrp	x9, _ATMCI_TXBUFE@GOTPAGE
Lloh17:
	ldr	x9, [x9, _ATMCI_TXBUFE@GOTPAGEOFF]
Lloh18:
	ldr	w27, [x8]
Lloh19:
	ldr	w28, [x9]
Lloh20:
	adrp	x8, _ATMCI_RXBUFF@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ATMCI_RXBUFF@GOTPAGEOFF]
Lloh22:
	adrp	x9, _ATMCI_BLKE@GOTPAGE
Lloh23:
	ldr	x9, [x9, _ATMCI_BLKE@GOTPAGEOFF]
Lloh24:
	ldr	w24, [x8]
Lloh25:
	ldr	w25, [x9]
Lloh26:
	adrp	x8, _ATMCI_ENDRX@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ATMCI_ENDRX@GOTPAGEOFF]
Lloh28:
	ldr	w26, [x8]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_atmci_readl
	and	w22, w0, #0xffff
	ldr	w0, [x20, #4]
	bl	_ATMCI_BLKLEN
	orr	w2, w0, w22
	ldr	w1, [x21]
	mov	x0, x19
	bl	_atmci_writel
	ldp	w9, w8, [x20, #4]
	mul	w8, w9, w8
	str	w8, [x19, #4]
	ldr	x21, [x19, #40]
	ldp	w23, w22, [x20, #12]
	mov	x0, x20
	bl	_mmc_get_dma_dir
	mov	x3, x0
	mov	x0, x21
	mov	x1, x22
	mov	x2, x23
	bl	_dma_map_sg
	ldr	w8, [x19, #24]
	cbz	w8, LBB0_5
LBB0_1:
	ldr	w8, [x19, #4]
LBB0_2:
	cbz	w8, LBB0_4
; %bb.3:
	ldr	w8, [x20]
Lloh29:
	adrp	x9, _XFER_RECEIVE@GOTPAGE
Lloh30:
	ldr	x9, [x9, _XFER_RECEIVE@GOTPAGEOFF]
Lloh31:
	adrp	x10, _MMC_DATA_READ@GOTPAGE
Lloh32:
	ldr	x10, [x10, _MMC_DATA_READ@GOTPAGEOFF]
Lloh33:
	ldr	w10, [x10]
Lloh34:
	adrp	x11, _XFER_TRANSMIT@GOTPAGE
Lloh35:
	ldr	x11, [x11, _XFER_TRANSMIT@GOTPAGEOFF]
	tst	w10, w8
	csel	x8, x11, x9, eq
	ldr	w1, [x8]
	mov	x0, x19
	bl	_atmci_pdc_set_both_buf
LBB0_4:
	orr	w8, w28, w27
	orr	w8, w8, w25
	orr	w9, w24, w26
	ldp	w11, w10, [sp, #4]              ; 8-byte Folded Reload
	tst	w11, w10
	csel	w8, w8, w9, eq
	ldr	w9, [sp, #12]                   ; 4-byte Folded Reload
	orr	w0, w8, w9
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_5:
	ldr	x8, [x19, #32]
	ldr	w9, [x8]
Lloh36:
	adrp	x10, _MMC_DATA_WRITE@GOTPAGE
Lloh37:
	ldr	x10, [x10, _MMC_DATA_WRITE@GOTPAGEOFF]
Lloh38:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_1
; %bb.6:
	ldp	w1, w0, [x8, #12]
	ldr	x2, [x19, #8]
	ldr	w3, [x19, #4]
	bl	_sg_copy_to_buffer
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_1
; %bb.7:
	ldr	w8, [x19, #4]
	cmp	w8, #1
	b.lt	LBB0_2
; %bb.8:
	mov	x21, #0
	ldr	x9, [x19, #8]
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	lsl	x22, x21, #2
	ldr	w0, [x9, x22]
	bl	_swab32
	ldr	x9, [x19, #8]
	str	w0, [x9, x22]
	add	x21, x21, #1
	ldrsw	x8, [x19, #4]
	cmp	x21, x8
	b.lt	LBB0_9
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh24
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh18
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_EINPROGRESS,4,2                ; @EINPROGRESS
	.comm	_ATMCI_DATA_ERROR_FLAGS,4,2     ; @ATMCI_DATA_ERROR_FLAGS
	.comm	_ATMCI_MR,4,2                   ; @ATMCI_MR
	.comm	_ATMCI_MR_PDCMODE,4,2           ; @ATMCI_MR_PDCMODE
	.comm	_MMC_DATA_READ,4,2              ; @MMC_DATA_READ
	.comm	_ATMCI_ENDRX,4,2                ; @ATMCI_ENDRX
	.comm	_ATMCI_RXBUFF,4,2               ; @ATMCI_RXBUFF
	.comm	_ATMCI_ENDTX,4,2                ; @ATMCI_ENDTX
	.comm	_ATMCI_TXBUFE,4,2               ; @ATMCI_TXBUFE
	.comm	_ATMCI_BLKE,4,2                 ; @ATMCI_BLKE
	.comm	_MMC_DATA_WRITE,4,2             ; @MMC_DATA_WRITE
	.comm	_XFER_RECEIVE,4,2               ; @XFER_RECEIVE
	.comm	_XFER_TRANSMIT,4,2              ; @XFER_TRANSMIT
	.no_dead_strip	_atmci_prepare_data_pdc
.subsections_via_symbols
