	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dma_setup
_dma_setup:                             ## @dma_setup
	.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	%rsi, %r13
	movq	%rdi, %r14
	movslq	(%rsi), %r15
	movq	_edma_map@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	64(%rsi), %ecx
	movl	%ecx, 4(%rax,%r15,8)
	movl	60(%rsi), %ecx
	movl	%ecx, (%rax,%r15,8)
	movl	%r15d, %edi
	callq	_DMA_TCDn_SADDR
	movl	56(%r13), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_TCD_WRITE4
	movl	%r15d, %edi
	callq	_DMA_TCDn_DADDR
	movl	52(%r13), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_TCD_WRITE4
	movq	_TCD_ATTR_SMOD_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	4(%r13), %eax
	movl	8(%r13), %edx
	shll	%cl, %eax
	movq	_TCD_ATTR_DMOD_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edx
	movl	12(%r13), %esi
	movq	_TCD_ATTR_SSIZE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %esi
	movq	_TCD_ATTR_DSIZE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	16(%r13), %ebx
	shll	%cl, %ebx
	orl	%eax, %edx
	orl	%esi, %ebx
	orl	%edx, %ebx
	movl	%r15d, %edi
	callq	_DMA_TCDn_ATTR
	movq	%r14, %rdi
	movl	%eax, %esi
	movl	%ebx, %edx
	callq	_TCD_WRITE2
	movl	%r15d, %edi
	callq	_DMA_TCDn_SOFF
	movl	20(%r13), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_TCD_WRITE2
	movl	%r15d, %edi
	callq	_DMA_TCDn_DOFF
	movl	24(%r13), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_TCD_WRITE2
	movl	%r15d, %edi
	callq	_DMA_TCDn_SLAST
	movl	48(%r13), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_TCD_WRITE4
	movl	%r15d, %edi
	callq	_DMA_TCDn_DLASTSGA
	movl	44(%r13), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_TCD_WRITE4
	movl	%r15d, %edi
	callq	_DMA_TCDn_NBYTES_MLOFFYES
	movl	40(%r13), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_TCD_WRITE4
	movl	28(%r13), %ebx
	movl	%r15d, %edi
	callq	_DMA_TCDn_CITER_ELINKNO
	movq	%r14, %rdi
	movl	%eax, %esi
	movl	%ebx, %edx
	callq	_TCD_WRITE2
	movl	%r15d, %edi
	callq	_DMA_TCDn_BITER_ELINKNO
	movq	%r14, %rdi
	movl	%eax, %esi
	movl	%ebx, %edx
	callq	_TCD_WRITE2
	movq	_TCD_CSR_INTMAJOR@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	cmpl	$1, 32(%r13)
	jne	LBB0_2
## %bb.1:
	movq	_TCD_CSR_MAJORELINK@GOTPCREL(%rip), %rax
	orl	(%rax), %r12d
	movl	36(%r13), %eax
	movq	_TCD_CSR_MAJORELINKCH_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	orl	%eax, %r12d
LBB0_2:
	movl	%r15d, %edi
	callq	_DMA_TCDn_CSR
	movq	%r14, %rdi
	movl	%eax, %esi
	movl	%r12d, %edx
	callq	_TCD_WRITE2
	movq	_DMA_ERQ@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_READ4
	btsl	%r15d, %eax
	movl	(%rbx), %esi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_WRITE4
	movq	_DMA_EEI@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_READ4
	btsl	%r15d, %eax
	movl	(%rbx), %esi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_WRITE4
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_edma_map,8,3                   ## @edma_map
	.comm	_TCD_ATTR_SMOD_SHIFT,4,2        ## @TCD_ATTR_SMOD_SHIFT
	.comm	_TCD_ATTR_DMOD_SHIFT,4,2        ## @TCD_ATTR_DMOD_SHIFT
	.comm	_TCD_ATTR_SSIZE_SHIFT,4,2       ## @TCD_ATTR_SSIZE_SHIFT
	.comm	_TCD_ATTR_DSIZE_SHIFT,4,2       ## @TCD_ATTR_DSIZE_SHIFT
	.comm	_TCD_CSR_INTMAJOR,4,2           ## @TCD_CSR_INTMAJOR
	.comm	_TCD_CSR_MAJORELINK,4,2         ## @TCD_CSR_MAJORELINK
	.comm	_TCD_CSR_MAJORELINKCH_SHIFT,4,2 ## @TCD_CSR_MAJORELINKCH_SHIFT
	.comm	_DMA_ERQ,4,2                    ## @DMA_ERQ
	.comm	_DMA_EEI,4,2                    ## @DMA_EEI
	.no_dead_strip	_dma_setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dma_setup
_dma_setup:                             ; @dma_setup
	.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	x21, x1
	mov	x19, x0
	ldrsw	x20, [x1]
Lloh0:
	adrp	x8, _edma_map@GOTPAGE
Lloh1:
	ldr	x8, [x8, _edma_map@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldur	d0, [x1, #60]
	str	d0, [x8, x20, lsl #3]
	mov	x0, x20
	bl	_DMA_TCDn_SADDR
	mov	x1, x0
	ldr	w2, [x21, #56]
	mov	x0, x19
	bl	_TCD_WRITE4
	mov	x0, x20
	bl	_DMA_TCDn_DADDR
	mov	x1, x0
	ldr	w2, [x21, #52]
	mov	x0, x19
	bl	_TCD_WRITE4
Lloh3:
	adrp	x8, _TCD_ATTR_SMOD_SHIFT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TCD_ATTR_SMOD_SHIFT@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ldp	w9, w10, [x21, #4]
	lsl	w8, w9, w8
Lloh6:
	adrp	x9, _TCD_ATTR_DMOD_SHIFT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _TCD_ATTR_DMOD_SHIFT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	lsl	w9, w10, w9
	orr	w8, w9, w8
Lloh9:
	adrp	x9, _TCD_ATTR_SSIZE_SHIFT@GOTPAGE
Lloh10:
	ldr	x9, [x9, _TCD_ATTR_SSIZE_SHIFT@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	ldp	w10, w11, [x21, #12]
	lsl	w9, w10, w9
	orr	w8, w8, w9
Lloh12:
	adrp	x9, _TCD_ATTR_DSIZE_SHIFT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _TCD_ATTR_DSIZE_SHIFT@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	lsl	w9, w11, w9
	orr	w22, w8, w9
	mov	x0, x20
	bl	_DMA_TCDn_ATTR
	mov	x1, x0
	mov	x0, x19
	mov	x2, x22
	bl	_TCD_WRITE2
	mov	x0, x20
	bl	_DMA_TCDn_SOFF
	mov	x1, x0
	ldr	w2, [x21, #20]
	mov	x0, x19
	bl	_TCD_WRITE2
	mov	x0, x20
	bl	_DMA_TCDn_DOFF
	mov	x1, x0
	ldr	w2, [x21, #24]
	mov	x0, x19
	bl	_TCD_WRITE2
	mov	x0, x20
	bl	_DMA_TCDn_SLAST
	mov	x1, x0
	ldr	w2, [x21, #48]
	mov	x0, x19
	bl	_TCD_WRITE4
	mov	x0, x20
	bl	_DMA_TCDn_DLASTSGA
	mov	x1, x0
	ldr	w2, [x21, #44]
	mov	x0, x19
	bl	_TCD_WRITE4
	mov	x0, x20
	bl	_DMA_TCDn_NBYTES_MLOFFYES
	mov	x1, x0
	ldr	w2, [x21, #40]
	mov	x0, x19
	bl	_TCD_WRITE4
	ldr	w22, [x21, #28]
	mov	x0, x20
	bl	_DMA_TCDn_CITER_ELINKNO
	mov	x1, x0
	mov	x0, x19
	mov	x2, x22
	bl	_TCD_WRITE2
	mov	x0, x20
	bl	_DMA_TCDn_BITER_ELINKNO
	mov	x1, x0
	mov	x0, x19
	mov	x2, x22
	bl	_TCD_WRITE2
Lloh15:
	adrp	x8, _TCD_CSR_INTMAJOR@GOTPAGE
Lloh16:
	ldr	x8, [x8, _TCD_CSR_INTMAJOR@GOTPAGEOFF]
Lloh17:
	ldr	w22, [x8]
	ldr	w8, [x21, #32]
	cmp	w8, #1
	b.ne	LBB0_2
; %bb.1:
Lloh18:
	adrp	x8, _TCD_CSR_MAJORELINK@GOTPAGE
Lloh19:
	ldr	x8, [x8, _TCD_CSR_MAJORELINK@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	orr	w8, w8, w22
	ldr	w9, [x21, #36]
Lloh21:
	adrp	x10, _TCD_CSR_MAJORELINKCH_SHIFT@GOTPAGE
Lloh22:
	ldr	x10, [x10, _TCD_CSR_MAJORELINKCH_SHIFT@GOTPAGEOFF]
Lloh23:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	orr	w22, w8, w9
LBB0_2:
	mov	x0, x20
	bl	_DMA_TCDn_CSR
	mov	x1, x0
	mov	x0, x19
	mov	x2, x22
	bl	_TCD_WRITE2
Lloh24:
	adrp	x21, _DMA_ERQ@GOTPAGE
Lloh25:
	ldr	x21, [x21, _DMA_ERQ@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_READ4
	mov	w8, #1
	lsl	w20, w8, w20
	orr	w2, w0, w20
	ldr	w1, [x21]
	mov	x0, x19
	bl	_WRITE4
Lloh26:
	adrp	x21, _DMA_EEI@GOTPAGE
Lloh27:
	ldr	x21, [x21, _DMA_EEI@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_READ4
	orr	w2, w0, w20
	ldr	w1, [x21]
	mov	x0, x19
	bl	_WRITE4
	mov	w0, #0
	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	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_edma_map,8,3                   ; @edma_map
	.comm	_TCD_ATTR_SMOD_SHIFT,4,2        ; @TCD_ATTR_SMOD_SHIFT
	.comm	_TCD_ATTR_DMOD_SHIFT,4,2        ; @TCD_ATTR_DMOD_SHIFT
	.comm	_TCD_ATTR_SSIZE_SHIFT,4,2       ; @TCD_ATTR_SSIZE_SHIFT
	.comm	_TCD_ATTR_DSIZE_SHIFT,4,2       ; @TCD_ATTR_DSIZE_SHIFT
	.comm	_TCD_CSR_INTMAJOR,4,2           ; @TCD_CSR_INTMAJOR
	.comm	_TCD_CSR_MAJORELINK,4,2         ; @TCD_CSR_MAJORELINK
	.comm	_TCD_CSR_MAJORELINKCH_SHIFT,4,2 ; @TCD_CSR_MAJORELINKCH_SHIFT
	.comm	_DMA_ERQ,4,2                    ; @DMA_ERQ
	.comm	_DMA_EEI,4,2                    ; @DMA_EEI
	.no_dead_strip	_dma_setup
.subsections_via_symbols
