	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mxs_dma_enable_chan
_mxs_dma_enable_chan:                   ## @mxs_dma_enable_chan
	.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
	callq	_to_mxs_dma_chan
	movq	%rax, %r14
	movq	16(%rax), %r13
	movl	(%rax), %r12d
	movl	12(%rax), %r15d
	movq	(%r13), %rbx
	movq	%r13, %rdi
	movl	%r15d, %esi
	callq	_HW_APBHX_CHn_NXTCMDAR
	addq	%rax, %rbx
	movl	%r12d, %edi
	movq	%rbx, %rsi
	callq	_writel
	movl	4(%r14), %eax
	movq	_MXS_DMA_USE_SEMAPHORE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_2
## %bb.1:
	movq	_MXS_DMA_SG_LOOP@GOTPCREL(%rip), %rcx
	movl	$2, %r12d
	testl	%eax, (%rcx)
	jne	LBB0_3
LBB0_2:
	movl	$1, %r12d
LBB0_3:
	movq	(%r13), %rbx
	movq	%r13, %rdi
	movl	%r15d, %esi
	callq	_HW_APBHX_CHn_SEMA
	addq	%rax, %rbx
	movl	%r12d, %edi
	movq	%rbx, %rsi
	callq	_writel
	movl	$0, 8(%r14)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MXS_DMA_USE_SEMAPHORE,4,2      ## @MXS_DMA_USE_SEMAPHORE
	.comm	_MXS_DMA_SG_LOOP,4,2            ## @MXS_DMA_SG_LOOP
	.no_dead_strip	_mxs_dma_enable_chan
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mxs_dma_enable_chan
_mxs_dma_enable_chan:                   ; @mxs_dma_enable_chan
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	bl	_to_mxs_dma_chan
	mov	x19, x0
	ldr	x20, [x0, #16]
	ldr	w21, [x0, #12]
	ldr	w22, [x0]
	ldr	x23, [x20]
	mov	x0, x20
	mov	x1, x21
	bl	_HW_APBHX_CHn_NXTCMDAR
	add	x1, x0, x23
	mov	x0, x22
	bl	_writel
	ldr	w8, [x19, #4]
Lloh0:
	adrp	x9, _MXS_DMA_USE_SEMAPHORE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MXS_DMA_USE_SEMAPHORE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.1:
Lloh3:
	adrp	x9, _MXS_DMA_SG_LOOP@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MXS_DMA_SG_LOOP@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.2:
	mov	w22, #2
	b	LBB0_4
LBB0_3:
	mov	w22, #1
LBB0_4:
	ldr	x23, [x20]
	mov	x0, x20
	mov	x1, x21
	bl	_HW_APBHX_CHn_SEMA
	add	x1, x0, x23
	mov	x0, x22
	bl	_writel
	str	wzr, [x19, #8]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_MXS_DMA_USE_SEMAPHORE,4,2      ; @MXS_DMA_USE_SEMAPHORE
	.comm	_MXS_DMA_SG_LOOP,4,2            ; @MXS_DMA_SG_LOOP
	.no_dead_strip	_mxs_dma_enable_chan
.subsections_via_symbols
