	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function jz4780_dma_prep_dma_cyclic
_jz4780_dma_prep_dma_cyclic:            ## @jz4780_dma_prep_dma_cyclic
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %r15
	movl	%r8d, -52(%rbp)                 ## 4-byte Spill
	movq	%rcx, %r12
	movq	%rdx, %r14
	movq	%rsi, %rbx
	callq	_to_jz4780_dma_chan
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, %rax
	orq	%r12, %rax
	shrq	$32, %rax
	je	LBB0_1
## %bb.2:
	movq	%r14, %rax
	xorl	%edx, %edx
	divq	%r12
	movq	%rax, %r13
	testq	%rdx, %rdx
	jne	LBB0_9
	jmp	LBB0_4
LBB0_1:
	movl	%r14d, %eax
	xorl	%edx, %edx
	divl	%r12d
                                        ## kill: def $edx killed $edx def $rdx
	movl	%eax, %r13d
	testq	%rdx, %rdx
	jne	LBB0_9
LBB0_4:
	movq	_DMA_CYCLIC@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %esi
	callq	_jz4780_dma_desc_alloc
	testq	%rax, %rax
	je	LBB0_9
## %bb.5:
	movq	%rax, %r14
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	testl	%r13d, %r13d
	je	LBB0_13
## %bb.6:
	leal	-1(%r13), %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	%r13d, %r13d
	movq	8(%r14), %rax
	xorl	%r15d, %r15d
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_7 Depth=1
	addq	%r12, %rbx
	incq	%r15
	cmpq	%r13, %r15
	je	LBB0_13
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	leaq	(%rax,%r15,8), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rdx
	movq	%r12, %rcx
	movl	-52(%rbp), %r8d                 ## 4-byte Reload
	callq	_jz4780_dma_setup_hwdesc
	testl	%eax, %eax
	js	LBB0_8
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	_JZ_DMA_DCM_LINK@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_JZ_DMA_DCM_TIE@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	8(%r14), %rax
	orl	%ecx, (%rax,%r15,8)
	cmpq	-72(%rbp), %r15                 ## 8-byte Folded Reload
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=1
	movl	%r15d, %ecx
	shll	$23, %ecx
	addl	$8388608, %ecx                  ## imm = 0x800000
	andl	$-16777216, %ecx                ## imm = 0xFF000000
	orl	%ecx, 4(%rax,%r15,8)
	jmp	LBB0_12
LBB0_13:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rsi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_vchan_tx_prep                  ## TAILCALL
LBB0_8:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rdi
	callq	_jz4780_dma_desc_free
LBB0_9:
	xorl	%eax, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_CYCLIC,4,2                 ## @DMA_CYCLIC
	.comm	_JZ_DMA_DCM_TIE,4,2             ## @JZ_DMA_DCM_TIE
	.comm	_JZ_DMA_DCM_LINK,4,2            ## @JZ_DMA_DCM_LINK
	.no_dead_strip	_jz4780_dma_prep_dma_cyclic
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function jz4780_dma_prep_dma_cyclic
_jz4780_dma_prep_dma_cyclic:            ; @jz4780_dma_prep_dma_cyclic
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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, x5
	mov	x20, x4
	mov	x21, x3
	mov	x24, x2
	mov	x22, x1
	bl	_to_jz4780_dma_chan
	udiv	x25, x24, x21
	msub	x8, x25, x21, x24
	cbz	x8, LBB0_2
LBB0_1:
	mov	x0, #0
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_2:
	mov	x23, x0
Lloh0:
	adrp	x8, _DMA_CYCLIC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DMA_CYCLIC@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x1, x25
	bl	_jz4780_dma_desc_alloc
	cbz	x0, LBB0_1
; %bb.3:
	mov	x24, x0
	str	x19, [sp, #8]                   ; 8-byte Folded Spill
	cbz	w25, LBB0_9
; %bb.4:
	mov	x26, #0
	mov	x27, #0
	sub	w28, w25, #1
	and	x25, x25, #0xffffffff
	ldr	x8, [x24, #8]
	mov	w19, #8388608
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x22, x22, x21
	add	x27, x27, #1
	add	w19, w19, #2048, lsl #12        ; =8388608
	add	x26, x26, #8
	cmp	x27, x25
	b.eq	LBB0_9
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	add	x1, x8, x26
	mov	x0, x23
	mov	x2, x22
	mov	x3, x21
	mov	x4, x20
	bl	_jz4780_dma_setup_hwdesc
	tbnz	w0, #31, LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
Lloh3:
	adrp	x8, _JZ_DMA_DCM_TIE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _JZ_DMA_DCM_TIE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _JZ_DMA_DCM_LINK@GOTPAGE
Lloh7:
	ldr	x9, [x9, _JZ_DMA_DCM_LINK@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w9, w9, w8
	ldr	x8, [x24, #8]
	ldr	w10, [x8, x26]
	orr	w9, w9, w10
	str	w9, [x8, x26]
	cmp	x27, x28
	b.eq	LBB0_5
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	and	w9, w19, #0xff000000
	add	x10, x8, x26
	ldr	w11, [x10, #4]
	orr	w9, w11, w9
	str	w9, [x10, #4]
	b	LBB0_5
LBB0_9:
	mov	x0, x23
	mov	x1, x24
	ldr	x2, [sp, #8]                    ; 8-byte Folded Reload
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_vchan_tx_prep
LBB0_10:
	ldr	x0, [x23, #8]
	bl	_jz4780_dma_desc_free
	b	LBB0_1
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_CYCLIC,4,2                 ; @DMA_CYCLIC
	.comm	_JZ_DMA_DCM_TIE,4,2             ; @JZ_DMA_DCM_TIE
	.comm	_JZ_DMA_DCM_LINK,4,2            ; @JZ_DMA_DCM_LINK
	.no_dead_strip	_jz4780_dma_prep_dma_cyclic
.subsections_via_symbols
