	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function jz4780_dma_desc_residue
_jz4780_dma_desc_residue:               ## @jz4780_dma_desc_residue
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r12d
	movq	%rsi, %r13
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_jz4780_dma_chan_parent
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	cmpl	%r12d, (%r13)
	jbe	LBB0_3
## %bb.1:
	movl	%r12d, %r15d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r13), %rax
	movl	(%rax,%r15,4), %r14d
	movl	$23, %edi
	xorl	%esi, %esi
	callq	_GENMASK
	andl	%r14d, %eax
	addl	%eax, %ebx
	incq	%r15
	movl	(%r13), %eax
	cmpq	%rax, %r15
	jb	LBB0_2
LBB0_3:
	testl	%r12d, %r12d
	je	LBB0_4
## %bb.5:
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movl	4(%r14), %esi
	movq	_JZ_DMA_REG_DTC@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_jz4780_dma_chn_readl
	addl	%eax, %ebx
	jmp	LBB0_6
LBB0_4:
	movq	-48(%rbp), %r14                 ## 8-byte Reload
LBB0_6:
	movb	(%r14), %cl
	shll	%cl, %ebx
	movq	%rbx, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_JZ_DMA_REG_DTC,4,2             ## @JZ_DMA_REG_DTC
	.no_dead_strip	_jz4780_dma_desc_residue
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function jz4780_dma_desc_residue
_jz4780_dma_desc_residue:               ; @jz4780_dma_desc_residue
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x2
	mov	x22, x1
	mov	x19, x0
	bl	_jz4780_dma_chan_parent
	mov	x21, x0
	ldr	w8, [x22]
	cmp	w8, w20
	b.ls	LBB0_6
; %bb.1:
	mov	w23, #0
	mov	w24, w20
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x22, #8]
	ldr	w25, [x8, x24, lsl #2]
	mov	w0, #23
	mov	w1, #0
	bl	_GENMASK
	and	w8, w0, w25
	add	w23, w8, w23
	add	x24, x24, #1
	ldr	w8, [x22]
	cmp	x24, x8
	b.lo	LBB0_2
; %bb.3:
	cbz	w20, LBB0_5
LBB0_4:
	ldr	w1, [x19, #4]
Lloh0:
	adrp	x8, _JZ_DMA_REG_DTC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _JZ_DMA_REG_DTC@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x0, x21
	bl	_jz4780_dma_chn_readl
	add	w23, w23, w0
LBB0_5:
	ldr	w8, [x19]
	lsl	w0, w23, w8
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_6:
	mov	w23, #0
	cbnz	w20, LBB0_4
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_JZ_DMA_REG_DTC,4,2             ; @JZ_DMA_REG_DTC
	.no_dead_strip	_jz4780_dma_desc_residue
.subsections_via_symbols
