	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dw_edma_device_transfer
_dw_edma_device_transfer:               ## @dw_edma_device_transfer
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movl	56(%rdi), %edi
	callq	_dchan2dw_edma_chan
	movq	%rax, %r14
	movl	(%rbx), %r12d
	movq	_DMA_MEM_TO_DEV@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jne	LBB0_2
## %bb.1:
	movq	(%r14), %rax
	movq	_EDMA_DIR_WRITE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_37
LBB0_2:
	movq	_DMA_DEV_TO_MEM@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jne	LBB0_4
## %bb.3:
	movq	(%r14), %rax
	movq	_EDMA_DIR_READ@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_37
LBB0_4:
	cmpq	$0, 8(%rbx)
	je	LBB0_7
## %bb.5:
	cmpq	$0, 32(%rbx)
	je	LBB0_37
## %bb.6:
	cmpl	$0, 16(%rbx)
	jne	LBB0_8
	jmp	LBB0_37
LBB0_7:
	cmpl	$0, 40(%rbx)
	jle	LBB0_37
LBB0_8:
	cmpl	$0, 40(%r14)
	je	LBB0_37
## %bb.9:
	movq	%r14, %rdi
	callq	_dw_edma_alloc_desc
	xorl	%edi, %edi
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_35
## %bb.10:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_dw_edma_alloc_chunk
	movq	%rax, %r15
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_11
LBB0_35:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	testq	%rdi, %rdi
	je	LBB0_37
## %bb.36:
	callq	_dw_edma_free_desc
LBB0_37:
	xorl	%eax, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	8(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	leaq	16(%rbx), %rcx
	xorl	%edx, %edx
	jmp	LBB0_14
LBB0_13:
	leaq	40(%rbx), %rcx
	movq	48(%rbx), %rdx
LBB0_14:
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movl	(%rcx), %r13d
	testl	%r13d, %r13d
	jle	LBB0_34
## %bb.15:
	movq	24(%r14), %rcx
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	movq	32(%r14), %rcx
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	jne	LBB0_17
LBB0_16:
	cmpq	$0, -56(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_34
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	movq	(%r15), %rax
	cmpq	8(%r14), %rax
	jne	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_17 Depth=1
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_dw_edma_alloc_chunk
	movq	%rax, %r15
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_35
LBB0_19:                                ##   in Loop: Header=BB0_17 Depth=1
	movq	%r15, %rdi
	callq	_dw_edma_alloc_burst
	movq	%rax, %r13
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_35
## %bb.20:                              ##   in Loop: Header=BB0_17 Depth=1
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	cmpq	$0, 8(%rbx)
	je	LBB0_22
## %bb.21:                              ##   in Loop: Header=BB0_17 Depth=1
	movq	32(%rbx), %rax
	jmp	LBB0_23
LBB0_22:                                ##   in Loop: Header=BB0_17 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_sg_dma_len
LBB0_23:                                ##   in Loop: Header=BB0_17 Depth=1
	movq	%rax, 16(%r13)
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	addl	%eax, 8(%r15)
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	addl	%eax, 4(%rcx)
	movq	_DMA_DEV_TO_MEM@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jne	LBB0_27
## %bb.24:                              ##   in Loop: Header=BB0_17 Depth=1
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, (%r13)
	cmpq	$0, 8(%rbx)
	je	LBB0_26
## %bb.25:                              ##   in Loop: Header=BB0_17 Depth=1
	movq	24(%rbx), %rax
	movq	%rax, 8(%r13)
	jmp	LBB0_30
LBB0_27:                                ##   in Loop: Header=BB0_17 Depth=1
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 8(%r13)
	cmpq	$0, 8(%rbx)
	je	LBB0_29
## %bb.28:                              ##   in Loop: Header=BB0_17 Depth=1
	movq	24(%rbx), %rax
	movq	%rax, (%r13)
	jmp	LBB0_30
LBB0_26:                                ##   in Loop: Header=BB0_17 Depth=1
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	callq	_sg_dma_address
	movq	%rax, 8(%r13)
	movq	%r15, %rdi
	callq	_sg_dma_len
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	addq	%rax, -80(%rbp)                 ## 8-byte Folded Spill
	jmp	LBB0_30
LBB0_29:                                ##   in Loop: Header=BB0_17 Depth=1
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	callq	_sg_dma_address
	movq	%rax, (%r13)
	movq	%r15, %rdi
	callq	_sg_dma_len
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	addq	%rax, -88(%rbp)                 ## 8-byte Folded Spill
LBB0_30:                                ##   in Loop: Header=BB0_17 Depth=1
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	cmpq	$0, 8(%rbx)
	jne	LBB0_32
## %bb.31:                              ##   in Loop: Header=BB0_17 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_sg_next
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
LBB0_32:                                ##   in Loop: Header=BB0_17 Depth=1
	decl	%r13d
	je	LBB0_34
## %bb.33:                              ##   in Loop: Header=BB0_17 Depth=1
	cmpq	$0, 8(%rbx)
	je	LBB0_16
	jmp	LBB0_17
LBB0_34:
	addq	$16, %r14
	movl	4(%rbx), %edx
	movq	%r14, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_vchan_tx_prep                  ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_MEM_TO_DEV,4,2             ## @DMA_MEM_TO_DEV
	.comm	_EDMA_DIR_WRITE,8,3             ## @EDMA_DIR_WRITE
	.comm	_DMA_DEV_TO_MEM,4,2             ## @DMA_DEV_TO_MEM
	.comm	_EDMA_DIR_READ,8,3              ## @EDMA_DIR_READ
	.no_dead_strip	_dw_edma_device_transfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dw_edma_device_transfer
_dw_edma_device_transfer:               ; @dw_edma_device_transfer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x19, x0
	ldr	w0, [x0, #56]
	bl	_dchan2dw_edma_chan
	mov	x20, x0
	ldr	w25, [x19]
Lloh0:
	adrp	x8, _DMA_MEM_TO_DEV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DMA_MEM_TO_DEV@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w25, w8
	b.ne	LBB0_2
; %bb.1:
	ldr	x8, [x20]
Lloh3:
	adrp	x9, _EDMA_DIR_WRITE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _EDMA_DIR_WRITE@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_13
LBB0_2:
Lloh6:
	adrp	x26, _DMA_DEV_TO_MEM@GOTPAGE
Lloh7:
	ldr	x26, [x26, _DMA_DEV_TO_MEM@GOTPAGEOFF]
	ldr	w8, [x26]
	cmp	w25, w8
	b.ne	LBB0_4
; %bb.3:
	ldr	x8, [x20]
Lloh8:
	adrp	x9, _EDMA_DIR_READ@GOTPAGE
Lloh9:
	ldr	x9, [x9, _EDMA_DIR_READ@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_13
LBB0_4:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_7
; %bb.5:
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_13
; %bb.6:
	ldr	w8, [x19, #16]
	cbnz	w8, LBB0_8
	b	LBB0_13
LBB0_7:
	ldr	w8, [x19, #40]
	cmp	w8, #1
	b.lt	LBB0_13
LBB0_8:
	ldr	w8, [x20, #40]
	cbz	w8, LBB0_13
; %bb.9:
	mov	x0, x20
	bl	_dw_edma_alloc_desc
	mov	x21, x0
	cmp	x0, #0
	cset	w0, eq
	bl	_unlikely
	cbnz	x0, LBB0_11
; %bb.10:
	mov	x0, x21
	bl	_dw_edma_alloc_chunk
	mov	x22, x0
	cmp	x0, #0
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_14
LBB0_11:
	cbz	x21, LBB0_13
; %bb.12:
	mov	x0, x21
	bl	_dw_edma_free_desc
LBB0_13:
	mov	x0, #0
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_14:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_16
; %bb.15:
	str	xzr, [sp, #24]                  ; 8-byte Folded Spill
	add	x9, x19, #16
	b	LBB0_17
LBB0_16:
	add	x9, x19, #40
	ldr	x10, [x19, #48]
	str	x10, [sp, #24]                  ; 8-byte Folded Spill
LBB0_17:
	ldr	w27, [x9]
	cmp	w27, #1
	b.lt	LBB0_38
; %bb.18:
	ldp	x23, x28, [x20, #24]
	cbnz	x8, LBB0_20
LBB0_19:
	ldr	x8, [sp, #24]                   ; 8-byte Folded Reload
	cbz	x8, LBB0_38
LBB0_20:                                ; =>This Inner Loop Header: Depth=1
	stp	x28, x23, [sp, #8]              ; 16-byte Folded Spill
	ldr	x8, [x22]
	ldr	x9, [x20, #8]
	cmp	x8, x9
	b.ne	LBB0_22
; %bb.21:                               ;   in Loop: Header=BB0_20 Depth=1
	mov	x0, x21
	bl	_dw_edma_alloc_chunk
	mov	x22, x0
	cmp	x0, #0
	cset	w0, eq
	bl	_unlikely
	cbnz	x0, LBB0_11
LBB0_22:                                ;   in Loop: Header=BB0_20 Depth=1
	mov	x0, x22
	bl	_dw_edma_alloc_burst
	mov	x24, x0
	cmp	x0, #0
	cset	w0, eq
	bl	_unlikely
	cbnz	x0, LBB0_11
; %bb.23:                               ;   in Loop: Header=BB0_20 Depth=1
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_25
; %bb.24:                               ;   in Loop: Header=BB0_20 Depth=1
	ldr	x0, [x19, #32]
	b	LBB0_26
LBB0_25:                                ;   in Loop: Header=BB0_20 Depth=1
	ldr	x0, [sp, #24]                   ; 8-byte Folded Reload
	bl	_sg_dma_len
LBB0_26:                                ;   in Loop: Header=BB0_20 Depth=1
	str	x0, [x24, #16]
	ldr	w8, [x22, #8]
	add	w8, w8, w0
	str	w8, [x22, #8]
	ldr	w8, [x21, #4]
	add	w8, w8, w0
	str	w8, [x21, #4]
	ldr	w8, [x26]
	cmp	w25, w8
	b.ne	LBB0_29
; %bb.27:                               ;   in Loop: Header=BB0_20 Depth=1
	ldr	x28, [sp, #8]                   ; 8-byte Folded Reload
	str	x28, [x24]
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_31
; %bb.28:                               ;   in Loop: Header=BB0_20 Depth=1
	ldr	x8, [x19, #24]
	str	x8, [x24, #8]
	ldr	x23, [sp, #16]                  ; 8-byte Folded Reload
	b	LBB0_34
LBB0_29:                                ;   in Loop: Header=BB0_20 Depth=1
	ldr	x23, [sp, #16]                  ; 8-byte Folded Reload
	str	x23, [x24, #8]
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_32
; %bb.30:                               ;   in Loop: Header=BB0_20 Depth=1
	ldr	x8, [x19, #24]
	str	x8, [x24]
	b	LBB0_33
LBB0_31:                                ;   in Loop: Header=BB0_20 Depth=1
	ldr	x23, [sp, #24]                  ; 8-byte Folded Reload
	mov	x0, x23
	bl	_sg_dma_address
	str	x0, [x24, #8]
	mov	x0, x23
	bl	_sg_dma_len
	add	x28, x28, x0
	ldr	x23, [sp, #16]                  ; 8-byte Folded Reload
	b	LBB0_34
LBB0_32:                                ;   in Loop: Header=BB0_20 Depth=1
	ldr	x28, [sp, #24]                  ; 8-byte Folded Reload
	mov	x0, x28
	bl	_sg_dma_address
	str	x0, [x24]
	mov	x0, x28
	bl	_sg_dma_len
	add	x23, x23, x0
LBB0_33:                                ;   in Loop: Header=BB0_20 Depth=1
	ldr	x28, [sp, #8]                   ; 8-byte Folded Reload
LBB0_34:                                ;   in Loop: Header=BB0_20 Depth=1
	ldr	x8, [x19, #8]
	cbnz	x8, LBB0_36
; %bb.35:                               ;   in Loop: Header=BB0_20 Depth=1
	ldr	x0, [sp, #24]                   ; 8-byte Folded Reload
	bl	_sg_next
	str	x0, [sp, #24]                   ; 8-byte Folded Spill
LBB0_36:                                ;   in Loop: Header=BB0_20 Depth=1
	subs	w27, w27, #1
	b.eq	LBB0_38
; %bb.37:                               ;   in Loop: Header=BB0_20 Depth=1
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_19
	b	LBB0_20
LBB0_38:
	add	x0, x20, #16
	ldr	w2, [x19, #4]
	mov	x1, x21
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	b	_vchan_tx_prep
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_MEM_TO_DEV,4,2             ; @DMA_MEM_TO_DEV
	.comm	_EDMA_DIR_WRITE,8,3             ; @EDMA_DIR_WRITE
	.comm	_DMA_DEV_TO_MEM,4,2             ; @DMA_DEV_TO_MEM
	.comm	_EDMA_DIR_READ,8,3              ; @EDMA_DIR_READ
	.no_dead_strip	_dw_edma_device_transfer
.subsections_via_symbols
