	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function k3_dma_config_write
_k3_dma_config_write:                   ## @k3_dma_config_write
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movl	%esi, %r15d
	callq	_to_k3_chan
	movq	%rax, %r14
	movq	_DMA_DEV_TO_MEM@GOTPCREL(%rip), %rax
	cmpl	%r15d, (%rax)
	jne	LBB0_2
## %bb.1:
	movq	_CX_CFG_DSTINCR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
	movl	20(%rbx), %eax
	movl	%eax, 8(%r14)
	movl	(%rbx), %r15d
	addq	$4, %rbx
	jmp	LBB0_5
LBB0_2:
	movq	_DMA_MEM_TO_DEV@GOTPCREL(%rip), %rax
	cmpl	%r15d, (%rax)
	jne	LBB0_3
## %bb.4:
	movq	_CX_CFG_SRCINCR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
	movl	16(%rbx), %eax
	movl	%eax, 8(%r14)
	movl	8(%rbx), %r15d
	addq	$12, %rbx
	jmp	LBB0_5
LBB0_3:
	movq	_DMA_SLAVE_BUSWIDTH_UNDEFINED@GOTPCREL(%rip), %rbx
	xorl	%r15d, %r15d
LBB0_5:
	movl	(%rbx), %edi
	movl	%edi, %ecx
	andl	$-4, %ecx
	movl	$3, %eax
	cmpl	$128, %ecx
	jne	LBB0_7
## %bb.6:
	callq	___ffs
LBB0_7:
	leal	-1(%r15), %ecx
	cmpl	$17, %r15d
	movl	$15, %edx
	cmovgel	%edx, %ecx
	cmpl	$1, %r15d
	cmovbl	%edx, %ecx
	movl	%eax, %edx
	shll	$12, %edx
	shll	$16, %eax
	orl	%edx, %eax
	movl	%ecx, %edx
	shll	$20, %edx
	shll	$24, %ecx
	orl	%edx, %ecx
	orl	%eax, %ecx
	orl	(%r14), %ecx
	movl	%ecx, (%r14)
	movq	_CX_CFG_MEM2PER@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	_CX_CFG_EN@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movl	4(%r14), %eax
	shll	$4, %eax
	orl	%ecx, %eax
	movl	%eax, (%r14)
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_SLAVE_BUSWIDTH_UNDEFINED,4,2 ## @DMA_SLAVE_BUSWIDTH_UNDEFINED
	.comm	_DMA_DEV_TO_MEM,4,2             ## @DMA_DEV_TO_MEM
	.comm	_CX_CFG_DSTINCR,4,2             ## @CX_CFG_DSTINCR
	.comm	_DMA_MEM_TO_DEV,4,2             ## @DMA_MEM_TO_DEV
	.comm	_CX_CFG_SRCINCR,4,2             ## @CX_CFG_SRCINCR
	.comm	_CX_CFG_MEM2PER,4,2             ## @CX_CFG_MEM2PER
	.comm	_CX_CFG_EN,4,2                  ## @CX_CFG_EN
	.no_dead_strip	_k3_dma_config_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function k3_dma_config_write
_k3_dma_config_write:                   ; @k3_dma_config_write
	.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	x20, x2
	mov	x21, x1
	bl	_to_k3_chan
	mov	x19, x0
Lloh0:
	adrp	x8, _DMA_DEV_TO_MEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DMA_DEV_TO_MEM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _CX_CFG_DSTINCR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CX_CFG_DSTINCR@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x19]
	ldr	w8, [x20, #20]
	str	w8, [x19, #8]
	ldr	w21, [x20]
	add	x8, x20, #4
	b	LBB0_5
LBB0_2:
Lloh6:
	adrp	x8, _DMA_MEM_TO_DEV@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DMA_MEM_TO_DEV@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_4
; %bb.3:
Lloh9:
	adrp	x8, _CX_CFG_SRCINCR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CX_CFG_SRCINCR@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	str	w8, [x19]
	ldr	w8, [x20, #16]
	str	w8, [x19, #8]
	ldr	w21, [x20, #8]
	add	x8, x20, #12
	b	LBB0_5
LBB0_4:
	mov	w21, #0
Lloh12:
	adrp	x8, _DMA_SLAVE_BUSWIDTH_UNDEFINED@GOTPAGE
Lloh13:
	ldr	x8, [x8, _DMA_SLAVE_BUSWIDTH_UNDEFINED@GOTPAGEOFF]
LBB0_5:
	ldr	w0, [x8]
	and	w8, w0, #0xfffffffc
	cmp	w8, #128
	b.ne	LBB0_7
; %bb.6:
	bl	___ffs
	b	LBB0_8
LBB0_7:
	mov	w0, #3
LBB0_8:
	sub	w8, w21, #1
	cmp	w21, #16
	ccmp	w21, #0, #4, le
	mov	w9, #15
	csel	w8, w9, w8, eq
	lsl	w9, w8, #20
	orr	w8, w9, w8, lsl #24
	orr	w8, w8, w0, lsl #16
	orr	w8, w8, w0, lsl #12
	ldp	w9, w10, [x19]
	orr	w8, w8, w9
	str	w8, [x19]
Lloh14:
	adrp	x9, _CX_CFG_MEM2PER@GOTPAGE
Lloh15:
	ldr	x9, [x9, _CX_CFG_MEM2PER@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
Lloh17:
	adrp	x11, _CX_CFG_EN@GOTPAGE
Lloh18:
	ldr	x11, [x11, _CX_CFG_EN@GOTPAGEOFF]
Lloh19:
	ldr	w11, [x11]
	orr	w8, w9, w8
	orr	w8, w8, w11
	orr	w8, w8, w10, lsl #4
	str	w8, [x19]
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_SLAVE_BUSWIDTH_UNDEFINED,4,2 ; @DMA_SLAVE_BUSWIDTH_UNDEFINED
	.comm	_DMA_DEV_TO_MEM,4,2             ; @DMA_DEV_TO_MEM
	.comm	_CX_CFG_DSTINCR,4,2             ; @CX_CFG_DSTINCR
	.comm	_DMA_MEM_TO_DEV,4,2             ; @DMA_MEM_TO_DEV
	.comm	_CX_CFG_SRCINCR,4,2             ; @CX_CFG_SRCINCR
	.comm	_CX_CFG_MEM2PER,4,2             ; @CX_CFG_MEM2PER
	.comm	_CX_CFG_EN,4,2                  ; @CX_CFG_EN
	.no_dead_strip	_k3_dma_config_write
.subsections_via_symbols
