	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function m2p_fill_desc
_m2p_fill_desc:                         ## @m2p_fill_desc
	.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, %rbx
	callq	_ep93xx_dma_get_active
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%rax, %r14
	leaq	16(%rbx), %rdi
	callq	_ep93xx_dma_chan_direction
	movq	_DMA_MEM_TO_DEV@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	cmpq	(%rcx), %rax
	sete	%dl
	movl	4(%r14,%rdx,4), %r15d
	cmpl	$0, (%rbx)
	movq	_M2P_MAXCNT1@GOTPCREL(%rip), %rax
	cmoveq	_M2P_MAXCNT0@GOTPCREL(%rip), %rax
	movq	_M2P_BASE1@GOTPCREL(%rip), %r12
	cmoveq	_M2P_BASE0@GOTPCREL(%rip), %r12
	movl	(%r14), %edi
	movq	(%rax), %rsi
	addq	8(%rbx), %rsi
	callq	_writel
	movq	(%r12), %rsi
	addq	8(%rbx), %rsi
	movl	%r15d, %edi
	callq	_writel
	xorb	$1, (%rbx)
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	%rbx, %rdi
	callq	_chan2dev
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_warn                       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"M2P: empty descriptor list\n"

	.comm	_DMA_MEM_TO_DEV,8,3             ## @DMA_MEM_TO_DEV
	.comm	_M2P_MAXCNT0,8,3                ## @M2P_MAXCNT0
	.comm	_M2P_BASE0,8,3                  ## @M2P_BASE0
	.comm	_M2P_MAXCNT1,8,3                ## @M2P_MAXCNT1
	.comm	_M2P_BASE1,8,3                  ## @M2P_BASE1
	.no_dead_strip	_m2p_fill_desc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function m2p_fill_desc
_m2p_fill_desc:                         ; @m2p_fill_desc
	.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
	bl	_ep93xx_dma_get_active
	cbz	x0, LBB0_2
; %bb.1:
	mov	x20, x0
	add	x0, x19, #16
	bl	_ep93xx_dma_chan_direction
Lloh0:
	adrp	x8, _DMA_MEM_TO_DEV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DMA_MEM_TO_DEV@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	mov	w9, #4
	mov	w10, #8
	cmp	x0, x8
	csel	x8, x10, x9, eq
	ldr	w21, [x20, x8]
	ldr	w8, [x19]
	ldr	w0, [x20]
	ldr	x9, [x19, #8]
Lloh3:
	adrp	x10, _M2P_MAXCNT0@GOTPAGE
Lloh4:
	ldr	x10, [x10, _M2P_MAXCNT0@GOTPAGEOFF]
Lloh5:
	adrp	x11, _M2P_MAXCNT1@GOTPAGE
Lloh6:
	ldr	x11, [x11, _M2P_MAXCNT1@GOTPAGEOFF]
	cmp	w8, #0
	csel	x8, x10, x11, eq
	ldr	x8, [x8]
	add	x1, x8, x9
Lloh7:
	adrp	x8, _M2P_BASE0@GOTPAGE
Lloh8:
	ldr	x8, [x8, _M2P_BASE0@GOTPAGEOFF]
Lloh9:
	adrp	x9, _M2P_BASE1@GOTPAGE
Lloh10:
	ldr	x9, [x9, _M2P_BASE1@GOTPAGEOFF]
	csel	x20, x8, x9, eq
	bl	_writel
	ldr	x8, [x19, #8]
	ldr	x9, [x20]
	add	x1, x9, x8
	mov	x0, x21
	bl	_writel
	ldr	w8, [x19]
	eor	w8, w8, #0x1
	str	w8, [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
LBB0_2:
	mov	x0, x19
	bl	_chan2dev
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	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
	b	_dev_warn
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"M2P: empty descriptor list\n"

	.comm	_DMA_MEM_TO_DEV,8,3             ; @DMA_MEM_TO_DEV
	.comm	_M2P_MAXCNT0,8,3                ; @M2P_MAXCNT0
	.comm	_M2P_BASE0,8,3                  ; @M2P_BASE0
	.comm	_M2P_MAXCNT1,8,3                ; @M2P_MAXCNT1
	.comm	_M2P_BASE1,8,3                  ; @M2P_BASE1
	.no_dead_strip	_m2p_fill_desc
.subsections_via_symbols
