	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function aw_mmc_prepare_dma
_aw_mmc_prepare_dma:                    ## @aw_mmc_prepare_dma
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	24(%rdi), %rdx
	movq	32(%rdi), %rax
	movq	(%rax), %r15
	movq	(%r15), %rax
	movl	(%rax), %ecx
	movq	_AW_MMC_DMA_SEGS@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	imull	(%rdx), %esi
	cmpl	%esi, %ecx
	jle	LBB0_2
## %bb.1:
	movq	_EFBIG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_10
LBB0_2:
	movq	%rdi, %rbx
	movl	16(%rdi), %esi
	movl	20(%rdi), %edi
	movl	8(%rax), %edx
	movq	_aw_dma_cb@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movl	$0, (%rsp)
	movq	%rbx, %r9
	callq	_bus_dmamap_load
	testl	%eax, %eax
	jne	LBB0_10
## %bb.3:
	movl	(%rbx), %eax
	testl	%eax, %eax
	jne	LBB0_10
## %bb.4:
	movq	(%r15), %rcx
	movq	_MMC_DATA_WRITE@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movq	_BUS_DMASYNC_PREWRITE@GOTPCREL(%rip), %r14
	movq	%r14, %rax
	andl	4(%rcx), %edx
	jne	LBB0_6
## %bb.5:
	movq	_BUS_DMASYNC_PREREAD@GOTPCREL(%rip), %rax
LBB0_6:
	movl	(%rax), %edx
	movl	16(%rbx), %esi
	movl	20(%rbx), %edi
	callq	_bus_dmamap_sync
	movl	8(%rbx), %esi
	movl	12(%rbx), %edi
	movl	(%r14), %edx
	callq	_bus_dmamap_sync
	movq	_AW_MMC_GCTL@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%rbx, %rdi
	callq	_AW_MMC_READ_4
	movq	_AW_MMC_GCTL_FIFO_AC_MOD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r14d
	notl	%r14d
	andl	%eax, %r14d
	movq	_AW_MMC_GCTL_DMA_ENB@GOTPCREL(%rip), %rax
	orl	(%rax), %r14d
	movl	(%r13), %esi
	movq	%rbx, %rdi
	movl	%r14d, %edx
	callq	_AW_MMC_WRITE_4
	movq	_AW_MMC_GCTL_DMA_RST@GOTPCREL(%rip), %rax
	orl	(%rax), %r14d
	movl	(%r13), %esi
	movq	%rbx, %rdi
	movl	%r14d, %edx
	callq	_AW_MMC_WRITE_4
	movq	_AW_MMC_DMAC@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	_AW_MMC_DMAC_IDMAC_SOFT_RST@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_AW_MMC_WRITE_4
	movl	(%r14), %esi
	movq	_AW_MMC_DMAC_IDMAC_IDMA_ON@GOTPCREL(%rip), %rax
	movq	_AW_MMC_DMAC_IDMAC_FIX_BURST@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_AW_MMC_WRITE_4
	movq	_AW_MMC_IDIE@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_AW_MMC_READ_4
	movq	(%r15), %rcx
	movl	(%r12), %edx
	andl	4(%rcx), %edx
	jne	LBB0_7
## %bb.8:
	movq	_AW_MMC_IDST_RX_INT@GOTPCREL(%rip), %rcx
	jmp	LBB0_9
LBB0_7:
	movq	_AW_MMC_IDST_TX_INT@GOTPCREL(%rip), %rcx
LBB0_9:
	orl	(%rcx), %eax
	movl	(%r14), %esi
	movq	%rbx, %rdi
	movl	%eax, %edx
	callq	_AW_MMC_WRITE_4
	movq	_AW_MMC_DLBA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	4(%rbx), %edx
	movq	%rbx, %rdi
	callq	_AW_MMC_WRITE_4
	movq	_AW_MMC_FWLR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AW_MMC_DMA_FTRGLEVEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_AW_MMC_WRITE_4
	xorl	%eax, %eax
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AW_MMC_DMA_SEGS,4,2            ## @AW_MMC_DMA_SEGS
	.comm	_EFBIG,4,2                      ## @EFBIG
	.comm	_aw_dma_cb,4,2                  ## @aw_dma_cb
	.comm	_MMC_DATA_WRITE,4,2             ## @MMC_DATA_WRITE
	.comm	_BUS_DMASYNC_PREWRITE,4,2       ## @BUS_DMASYNC_PREWRITE
	.comm	_BUS_DMASYNC_PREREAD,4,2        ## @BUS_DMASYNC_PREREAD
	.comm	_AW_MMC_GCTL,4,2                ## @AW_MMC_GCTL
	.comm	_AW_MMC_GCTL_FIFO_AC_MOD,4,2    ## @AW_MMC_GCTL_FIFO_AC_MOD
	.comm	_AW_MMC_GCTL_DMA_ENB,4,2        ## @AW_MMC_GCTL_DMA_ENB
	.comm	_AW_MMC_GCTL_DMA_RST,4,2        ## @AW_MMC_GCTL_DMA_RST
	.comm	_AW_MMC_DMAC,4,2                ## @AW_MMC_DMAC
	.comm	_AW_MMC_DMAC_IDMAC_SOFT_RST,4,2 ## @AW_MMC_DMAC_IDMAC_SOFT_RST
	.comm	_AW_MMC_DMAC_IDMAC_IDMA_ON,4,2  ## @AW_MMC_DMAC_IDMAC_IDMA_ON
	.comm	_AW_MMC_DMAC_IDMAC_FIX_BURST,4,2 ## @AW_MMC_DMAC_IDMAC_FIX_BURST
	.comm	_AW_MMC_IDIE,4,2                ## @AW_MMC_IDIE
	.comm	_AW_MMC_IDST_TX_INT,4,2         ## @AW_MMC_IDST_TX_INT
	.comm	_AW_MMC_IDST_RX_INT,4,2         ## @AW_MMC_IDST_RX_INT
	.comm	_AW_MMC_DLBA,4,2                ## @AW_MMC_DLBA
	.comm	_AW_MMC_FWLR,4,2                ## @AW_MMC_FWLR
	.comm	_AW_MMC_DMA_FTRGLEVEL,4,2       ## @AW_MMC_DMA_FTRGLEVEL
	.no_dead_strip	_aw_mmc_prepare_dma
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function aw_mmc_prepare_dma
_aw_mmc_prepare_dma:                    ; @aw_mmc_prepare_dma
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldp	x9, x8, [x0, #24]
	ldr	x21, [x8]
	ldr	x8, [x21]
	ldr	w3, [x8]
	ldr	w9, [x9]
Lloh0:
	adrp	x10, _AW_MMC_DMA_SEGS@GOTPAGE
Lloh1:
	ldr	x10, [x10, _AW_MMC_DMA_SEGS@GOTPAGEOFF]
Lloh2:
	ldr	w10, [x10]
	mul	w9, w10, w9
	cmp	w3, w9
	b.le	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _EFBIG@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EFBIG@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	b	LBB0_5
LBB0_2:
	mov	x19, x0
	ldr	w0, [x0, #20]
	ldr	w1, [x19, #16]
	ldr	w2, [x8, #8]
Lloh6:
	adrp	x8, _aw_dma_cb@GOTPAGE
Lloh7:
	ldr	x8, [x8, _aw_dma_cb@GOTPAGEOFF]
Lloh8:
	ldr	w4, [x8]
	mov	x5, x19
	mov	w6, #0
	bl	_bus_dmamap_load
	cbnz	w0, LBB0_5
; %bb.3:
	ldr	w0, [x19]
	cbnz	w0, LBB0_5
; %bb.4:
	ldr	x8, [x21]
	ldr	w8, [x8, #4]
Lloh9:
	adrp	x22, _MMC_DATA_WRITE@GOTPAGE
Lloh10:
	ldr	x22, [x22, _MMC_DATA_WRITE@GOTPAGEOFF]
Lloh11:
	adrp	x9, _BUS_DMASYNC_PREREAD@GOTPAGE
Lloh12:
	ldr	x9, [x9, _BUS_DMASYNC_PREREAD@GOTPAGEOFF]
Lloh13:
	adrp	x20, _BUS_DMASYNC_PREWRITE@GOTPAGE
Lloh14:
	ldr	x20, [x20, _BUS_DMASYNC_PREWRITE@GOTPAGEOFF]
	ldr	w10, [x22]
	tst	w10, w8
	csel	x8, x9, x20, eq
	ldr	w2, [x8]
	ldp	w1, w0, [x19, #16]
	bl	_bus_dmamap_sync
	ldp	w1, w0, [x19, #8]
	ldr	w2, [x20]
	bl	_bus_dmamap_sync
Lloh15:
	adrp	x23, _AW_MMC_GCTL@GOTPAGE
Lloh16:
	ldr	x23, [x23, _AW_MMC_GCTL@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x19
	bl	_AW_MMC_READ_4
Lloh17:
	adrp	x8, _AW_MMC_GCTL_FIFO_AC_MOD@GOTPAGE
Lloh18:
	ldr	x8, [x8, _AW_MMC_GCTL_FIFO_AC_MOD@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	bic	w8, w0, w8
Lloh20:
	adrp	x9, _AW_MMC_GCTL_DMA_ENB@GOTPAGE
Lloh21:
	ldr	x9, [x9, _AW_MMC_GCTL_DMA_ENB@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	orr	w20, w8, w9
	ldr	w1, [x23]
	mov	x0, x19
	mov	x2, x20
	bl	_AW_MMC_WRITE_4
Lloh23:
	adrp	x8, _AW_MMC_GCTL_DMA_RST@GOTPAGE
Lloh24:
	ldr	x8, [x8, _AW_MMC_GCTL_DMA_RST@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	orr	w2, w8, w20
	ldr	w1, [x23]
	mov	x0, x19
	bl	_AW_MMC_WRITE_4
Lloh26:
	adrp	x20, _AW_MMC_DMAC@GOTPAGE
Lloh27:
	ldr	x20, [x20, _AW_MMC_DMAC@GOTPAGEOFF]
	ldr	w1, [x20]
Lloh28:
	adrp	x8, _AW_MMC_DMAC_IDMAC_SOFT_RST@GOTPAGE
Lloh29:
	ldr	x8, [x8, _AW_MMC_DMAC_IDMAC_SOFT_RST@GOTPAGEOFF]
Lloh30:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_AW_MMC_WRITE_4
Lloh31:
	adrp	x8, _AW_MMC_DMAC_IDMAC_IDMA_ON@GOTPAGE
Lloh32:
	ldr	x8, [x8, _AW_MMC_DMAC_IDMAC_IDMA_ON@GOTPAGEOFF]
	ldr	w1, [x20]
Lloh33:
	ldr	w8, [x8]
Lloh34:
	adrp	x9, _AW_MMC_DMAC_IDMAC_FIX_BURST@GOTPAGE
Lloh35:
	ldr	x9, [x9, _AW_MMC_DMAC_IDMAC_FIX_BURST@GOTPAGEOFF]
Lloh36:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x19
	bl	_AW_MMC_WRITE_4
Lloh37:
	adrp	x20, _AW_MMC_IDIE@GOTPAGE
Lloh38:
	ldr	x20, [x20, _AW_MMC_IDIE@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_AW_MMC_READ_4
	ldr	x8, [x21]
	ldr	w8, [x8, #4]
Lloh39:
	adrp	x9, _AW_MMC_IDST_RX_INT@GOTPAGE
Lloh40:
	ldr	x9, [x9, _AW_MMC_IDST_RX_INT@GOTPAGEOFF]
Lloh41:
	adrp	x10, _AW_MMC_IDST_TX_INT@GOTPAGE
Lloh42:
	ldr	x10, [x10, _AW_MMC_IDST_TX_INT@GOTPAGEOFF]
	ldr	w11, [x22]
	tst	w11, w8
	csel	x8, x9, x10, eq
	ldr	w8, [x8]
	orr	w2, w8, w0
	ldr	w1, [x20]
	mov	x0, x19
	bl	_AW_MMC_WRITE_4
Lloh43:
	adrp	x8, _AW_MMC_DLBA@GOTPAGE
Lloh44:
	ldr	x8, [x8, _AW_MMC_DLBA@GOTPAGEOFF]
Lloh45:
	ldr	w1, [x8]
	ldr	w2, [x19, #4]
	mov	x0, x19
	bl	_AW_MMC_WRITE_4
Lloh46:
	adrp	x8, _AW_MMC_FWLR@GOTPAGE
Lloh47:
	ldr	x8, [x8, _AW_MMC_FWLR@GOTPAGEOFF]
Lloh48:
	ldr	w1, [x8]
Lloh49:
	adrp	x8, _AW_MMC_DMA_FTRGLEVEL@GOTPAGE
Lloh50:
	ldr	x8, [x8, _AW_MMC_DMA_FTRGLEVEL@GOTPAGEOFF]
Lloh51:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_AW_MMC_WRITE_4
	mov	w0, #0
LBB0_5:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGot	Lloh41, Lloh42
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_AW_MMC_DMA_SEGS,4,2            ; @AW_MMC_DMA_SEGS
	.comm	_EFBIG,4,2                      ; @EFBIG
	.comm	_aw_dma_cb,4,2                  ; @aw_dma_cb
	.comm	_MMC_DATA_WRITE,4,2             ; @MMC_DATA_WRITE
	.comm	_BUS_DMASYNC_PREWRITE,4,2       ; @BUS_DMASYNC_PREWRITE
	.comm	_BUS_DMASYNC_PREREAD,4,2        ; @BUS_DMASYNC_PREREAD
	.comm	_AW_MMC_GCTL,4,2                ; @AW_MMC_GCTL
	.comm	_AW_MMC_GCTL_FIFO_AC_MOD,4,2    ; @AW_MMC_GCTL_FIFO_AC_MOD
	.comm	_AW_MMC_GCTL_DMA_ENB,4,2        ; @AW_MMC_GCTL_DMA_ENB
	.comm	_AW_MMC_GCTL_DMA_RST,4,2        ; @AW_MMC_GCTL_DMA_RST
	.comm	_AW_MMC_DMAC,4,2                ; @AW_MMC_DMAC
	.comm	_AW_MMC_DMAC_IDMAC_SOFT_RST,4,2 ; @AW_MMC_DMAC_IDMAC_SOFT_RST
	.comm	_AW_MMC_DMAC_IDMAC_IDMA_ON,4,2  ; @AW_MMC_DMAC_IDMAC_IDMA_ON
	.comm	_AW_MMC_DMAC_IDMAC_FIX_BURST,4,2 ; @AW_MMC_DMAC_IDMAC_FIX_BURST
	.comm	_AW_MMC_IDIE,4,2                ; @AW_MMC_IDIE
	.comm	_AW_MMC_IDST_TX_INT,4,2         ; @AW_MMC_IDST_TX_INT
	.comm	_AW_MMC_IDST_RX_INT,4,2         ; @AW_MMC_IDST_RX_INT
	.comm	_AW_MMC_DLBA,4,2                ; @AW_MMC_DLBA
	.comm	_AW_MMC_FWLR,4,2                ; @AW_MMC_FWLR
	.comm	_AW_MMC_DMA_FTRGLEVEL,4,2       ; @AW_MMC_DMA_FTRGLEVEL
	.no_dead_strip	_aw_mmc_prepare_dma
.subsections_via_symbols
