	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sprd_dma_set_2stage_config
_sprd_dma_set_2stage_config:            ## @sprd_dma_set_2stage_config
	.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	%rdi, %r15
	addq	$16, %rdi
	callq	_to_sprd_dma_dev
	movq	%rax, %r14
	movl	4(%r15), %edx
	leal	-128(%rdx), %eax
	cmpl	$3, %eax
	ja	LBB0_12
## %bb.1:
	movl	(%r15), %ebx
	incl	%ebx
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_2:
	movq	_SPRD_DMA_GLB_SRC_CHN_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	movl	12(%r15), %edi
	decl	%edi
	callq	_BIT
	movq	_SPRD_DMA_GLB_TRG_OFFSET@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	orl	%ebx, %eax
	movq	_SPRD_DMA_GLB_2STAGE_EN@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	8(%r15), %edx
	movq	_SPRD_DMA_NO_INT@GOTPCREL(%rip), %rsi
	xorl	%r15d, %r15d
	movl	$0, %ecx
	cmpl	(%rsi), %edx
	je	LBB0_4
## %bb.3:
	movq	_SPRD_DMA_GLB_SRC_INT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
LBB0_4:
	orl	%ecx, %eax
	movq	_SPRD_DMA_GLB_2STAGE_GRP2@GOTPCREL(%rip), %rcx
	jmp	LBB0_16
LBB0_5:
	movq	_SPRD_DMA_GLB_DEST_CHN_OFFSET@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %ebx
	movq	_SPRD_DMA_GLB_DEST_CHN_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	movq	_SPRD_DMA_GLB_2STAGE_EN@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movl	8(%r15), %ecx
	movq	_SPRD_DMA_NO_INT@GOTPCREL(%rip), %rdx
	xorl	%r15d, %r15d
	movl	$0, %eax
	cmpl	(%rdx), %ecx
	je	LBB0_7
## %bb.6:
	movq	_SPRD_DMA_GLB_DEST_INT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_7:
	orl	%eax, %ebx
	movq	_SPRD_DMA_GLB_2STAGE_GRP2@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_8:
	movq	_SPRD_DMA_GLB_DEST_CHN_OFFSET@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %ebx
	movq	_SPRD_DMA_GLB_DEST_CHN_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	movq	_SPRD_DMA_GLB_2STAGE_EN@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movl	8(%r15), %ecx
	movq	_SPRD_DMA_NO_INT@GOTPCREL(%rip), %rdx
	xorl	%r15d, %r15d
	movl	$0, %eax
	cmpl	(%rdx), %ecx
	je	LBB0_10
## %bb.9:
	movq	_SPRD_DMA_GLB_DEST_INT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_10:
	orl	%eax, %ebx
	movq	_SPRD_DMA_GLB_2STAGE_GRP1@GOTPCREL(%rip), %rax
LBB0_11:
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%ebx, %edx
	movl	%ebx, %ecx
	jmp	LBB0_17
LBB0_12:
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_18
LBB0_13:
	movq	_SPRD_DMA_GLB_SRC_CHN_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	movl	12(%r15), %edi
	decl	%edi
	callq	_BIT
	movq	_SPRD_DMA_GLB_TRG_OFFSET@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	orl	%ebx, %eax
	movq	_SPRD_DMA_GLB_2STAGE_EN@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	8(%r15), %edx
	movq	_SPRD_DMA_NO_INT@GOTPCREL(%rip), %rsi
	xorl	%r15d, %r15d
	movl	$0, %ecx
	cmpl	(%rsi), %edx
	je	LBB0_15
## %bb.14:
	movq	_SPRD_DMA_GLB_SRC_INT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
LBB0_15:
	orl	%ecx, %eax
	movq	_SPRD_DMA_GLB_2STAGE_GRP1@GOTPCREL(%rip), %rcx
LBB0_16:
	movl	(%rcx), %esi
	movq	%r14, %rdi
	movl	%eax, %edx
	movl	%eax, %ecx
LBB0_17:
	callq	_sprd_dma_glb_update
LBB0_18:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_2, LBB0_2-LJTI0_0
.set L0_0_set_13, LBB0_13-LJTI0_0
.set L0_0_set_5, LBB0_5-LJTI0_0
.set L0_0_set_8, LBB0_8-LJTI0_0
LJTI0_0:
	.long	L0_0_set_2
	.long	L0_0_set_13
	.long	L0_0_set_5
	.long	L0_0_set_8
	.end_data_region
                                        ## -- End function
	.comm	_SPRD_DMA_GLB_SRC_CHN_MASK,4,2  ## @SPRD_DMA_GLB_SRC_CHN_MASK
	.comm	_SPRD_DMA_GLB_TRG_OFFSET,4,2    ## @SPRD_DMA_GLB_TRG_OFFSET
	.comm	_SPRD_DMA_GLB_2STAGE_EN,4,2     ## @SPRD_DMA_GLB_2STAGE_EN
	.comm	_SPRD_DMA_NO_INT,4,2            ## @SPRD_DMA_NO_INT
	.comm	_SPRD_DMA_GLB_SRC_INT,4,2       ## @SPRD_DMA_GLB_SRC_INT
	.comm	_SPRD_DMA_GLB_2STAGE_GRP1,4,2   ## @SPRD_DMA_GLB_2STAGE_GRP1
	.comm	_SPRD_DMA_GLB_2STAGE_GRP2,4,2   ## @SPRD_DMA_GLB_2STAGE_GRP2
	.comm	_SPRD_DMA_GLB_DEST_CHN_OFFSET,4,2 ## @SPRD_DMA_GLB_DEST_CHN_OFFSET
	.comm	_SPRD_DMA_GLB_DEST_CHN_MASK,4,2 ## @SPRD_DMA_GLB_DEST_CHN_MASK
	.comm	_SPRD_DMA_GLB_DEST_INT,4,2      ## @SPRD_DMA_GLB_DEST_INT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid channel mode setting %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_sprd_dma_set_2stage_config
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sprd_dma_set_2stage_config
_sprd_dma_set_2stage_config:            ; @sprd_dma_set_2stage_config
	.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, x0
	add	x0, x0, #16
	bl	_to_sprd_dma_dev
	mov	x19, x0
	ldr	w2, [x20, #4]
	sub	w9, w2, #128
	cmp	w9, #3
	b.hi	LBB0_3
; %bb.1:
	ldr	w8, [x20]
	add	w8, w8, #1
Lloh0:
	adrp	x10, lJTI0_0@PAGE
Lloh1:
	add	x10, x10, lJTI0_0@PAGEOFF
	adr	x11, LBB0_2
	ldrb	w12, [x10, x9]
	add	x11, x11, x12, lsl #2
	br	x11
LBB0_2:
Lloh2:
	adrp	x9, _SPRD_DMA_GLB_SRC_CHN_MASK@GOTPAGE
Lloh3:
	ldr	x9, [x9, _SPRD_DMA_GLB_SRC_CHN_MASK@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	and	w21, w9, w8
	ldr	w8, [x20, #12]
	sub	w0, w8, #1
	bl	_BIT
Lloh5:
	adrp	x8, _SPRD_DMA_GLB_TRG_OFFSET@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SPRD_DMA_GLB_TRG_OFFSET@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	lsl	w8, w0, w8
	orr	w8, w8, w21
Lloh8:
	adrp	x9, _SPRD_DMA_GLB_2STAGE_EN@GOTPAGE
Lloh9:
	ldr	x9, [x9, _SPRD_DMA_GLB_2STAGE_EN@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w8, w8, w9
	ldr	w9, [x20, #8]
Lloh11:
	adrp	x10, _SPRD_DMA_NO_INT@GOTPAGE
Lloh12:
	ldr	x10, [x10, _SPRD_DMA_NO_INT@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
Lloh14:
	adrp	x11, _SPRD_DMA_GLB_SRC_INT@GOTPAGE
Lloh15:
	ldr	x11, [x11, _SPRD_DMA_GLB_SRC_INT@GOTPAGEOFF]
	b	LBB0_6
LBB0_3:
	ldr	w0, [x19]
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh18:
	adrp	x8, _EINVAL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_10
LBB0_4:
Lloh21:
	adrp	x9, _SPRD_DMA_GLB_SRC_CHN_MASK@GOTPAGE
Lloh22:
	ldr	x9, [x9, _SPRD_DMA_GLB_SRC_CHN_MASK@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	and	w21, w9, w8
	ldr	w8, [x20, #12]
	sub	w0, w8, #1
	bl	_BIT
Lloh24:
	adrp	x8, _SPRD_DMA_GLB_TRG_OFFSET@GOTPAGE
Lloh25:
	ldr	x8, [x8, _SPRD_DMA_GLB_TRG_OFFSET@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	lsl	w8, w0, w8
	orr	w8, w8, w21
Lloh27:
	adrp	x9, _SPRD_DMA_GLB_2STAGE_EN@GOTPAGE
Lloh28:
	ldr	x9, [x9, _SPRD_DMA_GLB_2STAGE_EN@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	orr	w8, w8, w9
	ldr	w9, [x20, #8]
Lloh30:
	adrp	x10, _SPRD_DMA_NO_INT@GOTPAGE
Lloh31:
	ldr	x10, [x10, _SPRD_DMA_NO_INT@GOTPAGEOFF]
Lloh32:
	ldr	w10, [x10]
Lloh33:
	adrp	x11, _SPRD_DMA_GLB_SRC_INT@GOTPAGE
Lloh34:
	ldr	x11, [x11, _SPRD_DMA_GLB_SRC_INT@GOTPAGEOFF]
	b	LBB0_8
LBB0_5:
Lloh35:
	adrp	x9, _SPRD_DMA_GLB_DEST_CHN_OFFSET@GOTPAGE
Lloh36:
	ldr	x9, [x9, _SPRD_DMA_GLB_DEST_CHN_OFFSET@GOTPAGEOFF]
Lloh37:
	ldr	w9, [x9]
	lsl	w8, w8, w9
Lloh38:
	adrp	x9, _SPRD_DMA_GLB_DEST_CHN_MASK@GOTPAGE
Lloh39:
	ldr	x9, [x9, _SPRD_DMA_GLB_DEST_CHN_MASK@GOTPAGEOFF]
Lloh40:
	ldr	w9, [x9]
	and	w8, w8, w9
Lloh41:
	adrp	x9, _SPRD_DMA_GLB_2STAGE_EN@GOTPAGE
Lloh42:
	ldr	x9, [x9, _SPRD_DMA_GLB_2STAGE_EN@GOTPAGEOFF]
Lloh43:
	ldr	w9, [x9]
	orr	w8, w8, w9
	ldr	w9, [x20, #8]
Lloh44:
	adrp	x10, _SPRD_DMA_NO_INT@GOTPAGE
Lloh45:
	ldr	x10, [x10, _SPRD_DMA_NO_INT@GOTPAGEOFF]
Lloh46:
	ldr	w10, [x10]
Lloh47:
	adrp	x11, _SPRD_DMA_GLB_DEST_INT@GOTPAGE
Lloh48:
	ldr	x11, [x11, _SPRD_DMA_GLB_DEST_INT@GOTPAGEOFF]
LBB0_6:
	ldr	w11, [x11]
	cmp	w9, w10
	csel	w9, wzr, w11, eq
	orr	w2, w8, w9
Lloh49:
	adrp	x8, _SPRD_DMA_GLB_2STAGE_GRP2@GOTPAGE
Lloh50:
	ldr	x8, [x8, _SPRD_DMA_GLB_2STAGE_GRP2@GOTPAGEOFF]
	b	LBB0_9
LBB0_7:
Lloh51:
	adrp	x9, _SPRD_DMA_GLB_DEST_CHN_OFFSET@GOTPAGE
Lloh52:
	ldr	x9, [x9, _SPRD_DMA_GLB_DEST_CHN_OFFSET@GOTPAGEOFF]
Lloh53:
	ldr	w9, [x9]
	lsl	w8, w8, w9
Lloh54:
	adrp	x9, _SPRD_DMA_GLB_DEST_CHN_MASK@GOTPAGE
Lloh55:
	ldr	x9, [x9, _SPRD_DMA_GLB_DEST_CHN_MASK@GOTPAGEOFF]
Lloh56:
	ldr	w9, [x9]
	and	w8, w8, w9
Lloh57:
	adrp	x9, _SPRD_DMA_GLB_2STAGE_EN@GOTPAGE
Lloh58:
	ldr	x9, [x9, _SPRD_DMA_GLB_2STAGE_EN@GOTPAGEOFF]
Lloh59:
	ldr	w9, [x9]
	orr	w8, w8, w9
	ldr	w9, [x20, #8]
Lloh60:
	adrp	x10, _SPRD_DMA_NO_INT@GOTPAGE
Lloh61:
	ldr	x10, [x10, _SPRD_DMA_NO_INT@GOTPAGEOFF]
Lloh62:
	ldr	w10, [x10]
Lloh63:
	adrp	x11, _SPRD_DMA_GLB_DEST_INT@GOTPAGE
Lloh64:
	ldr	x11, [x11, _SPRD_DMA_GLB_DEST_INT@GOTPAGEOFF]
LBB0_8:
	ldr	w11, [x11]
	cmp	w9, w10
	csel	w9, wzr, w11, eq
	orr	w2, w8, w9
Lloh65:
	adrp	x8, _SPRD_DMA_GLB_2STAGE_GRP1@GOTPAGE
Lloh66:
	ldr	x8, [x8, _SPRD_DMA_GLB_2STAGE_GRP1@GOTPAGEOFF]
LBB0_9:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x3, x2
	bl	_sprd_dma_glb_update
	mov	w0, #0
LBB0_10:
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh49, Lloh50
	.loh AdrpLdrGot	Lloh63, Lloh64
	.loh AdrpLdrGotLdr	Lloh60, Lloh61, Lloh62
	.loh AdrpLdrGotLdr	Lloh57, Lloh58, Lloh59
	.loh AdrpLdrGotLdr	Lloh54, Lloh55, Lloh56
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpLdrGot	Lloh65, Lloh66
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_4-LBB0_2)>>2
	.byte	(LBB0_5-LBB0_2)>>2
	.byte	(LBB0_7-LBB0_2)>>2
                                        ; -- End function
	.comm	_SPRD_DMA_GLB_SRC_CHN_MASK,4,2  ; @SPRD_DMA_GLB_SRC_CHN_MASK
	.comm	_SPRD_DMA_GLB_TRG_OFFSET,4,2    ; @SPRD_DMA_GLB_TRG_OFFSET
	.comm	_SPRD_DMA_GLB_2STAGE_EN,4,2     ; @SPRD_DMA_GLB_2STAGE_EN
	.comm	_SPRD_DMA_NO_INT,4,2            ; @SPRD_DMA_NO_INT
	.comm	_SPRD_DMA_GLB_SRC_INT,4,2       ; @SPRD_DMA_GLB_SRC_INT
	.comm	_SPRD_DMA_GLB_2STAGE_GRP1,4,2   ; @SPRD_DMA_GLB_2STAGE_GRP1
	.comm	_SPRD_DMA_GLB_2STAGE_GRP2,4,2   ; @SPRD_DMA_GLB_2STAGE_GRP2
	.comm	_SPRD_DMA_GLB_DEST_CHN_OFFSET,4,2 ; @SPRD_DMA_GLB_DEST_CHN_OFFSET
	.comm	_SPRD_DMA_GLB_DEST_CHN_MASK,4,2 ; @SPRD_DMA_GLB_DEST_CHN_MASK
	.comm	_SPRD_DMA_GLB_DEST_INT,4,2      ; @SPRD_DMA_GLB_DEST_INT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid channel mode setting %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_sprd_dma_set_2stage_config
.subsections_via_symbols
