	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fsl_edma_desc_residue
_fsl_edma_desc_residue:                 ## @fsl_edma_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	$40, %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	(%rdi), %r15
	movq	8(%rdi), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	16(%rdi), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	(%r15), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	cmpl	$0, 4(%r15)
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	jle	LBB0_1
## %bb.2:
	xorl	%r14d, %r14d
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %rax
	movq	(%rax,%r14,8), %rax
	movl	12(%rax), %edi
	callq	_le32_to_cpu
	movq	%rax, %rbx
	movq	8(%r15), %rax
	movq	(%rax,%r14,8), %rax
	movl	8(%rax), %edi
	callq	_le16_to_cpu
	imulq	%rbx, %rax
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	addq	%rax, %r13
	incq	%r14
	movq	(%rbx), %rax
	movslq	4(%rax), %rax
	cmpq	%rax, %r14
	jl	LBB0_3
## %bb.4:
	testl	%r12d, %r12d
	jne	LBB0_5
	jmp	LBB0_14
LBB0_1:
	movq	%rdi, %rbx
	xorl	%r13d, %r13d
	testl	%r12d, %r12d
	je	LBB0_14
LBB0_5:
	movq	_DMA_MEM_TO_DEV@GOTPCREL(%rip), %rdx
	movq	8(%rbx), %rdi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	cmpl	(%rdx), %ecx
	jne	LBB0_7
## %bb.6:
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rax,%rcx,8), %rsi
	addq	$4, %rsi
	jmp	LBB0_8
LBB0_7:
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rax,%rcx,8), %rsi
LBB0_8:
	callq	_edma_readl
	movq	%rax, %rcx
	movq	(%rbx), %rax
	cmpl	$0, 4(%rax)
	jle	LBB0_14
## %bb.9:
	xorl	%r14d, %r14d
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_10 Depth=1
	incq	%r14
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movslq	4(%rax), %rax
	cmpq	%rax, %r14
	jge	LBB0_14
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %rax
	movq	(%rax,%r14,8), %rax
	movl	12(%rax), %edi
	callq	_le32_to_cpu
	movq	%rax, %rbx
	movq	8(%r15), %rax
	movq	(%rax,%r14,8), %rax
	movl	8(%rax), %edi
	callq	_le16_to_cpu
	movq	%rax, %r12
	imulq	%rbx, %r12
	xorl	%eax, %eax
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movq	_DMA_MEM_TO_DEV@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	sete	%al
	movq	8(%r15), %rcx
	movq	(%rcx,%r14,8), %rcx
	movl	(%rcx,%rax,4), %edi
	callq	_le32_to_cpu
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	subq	%r12, %r13
	cmpq	%rax, %rcx
	jb	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	addq	%r12, %rax
	cmpq	%rcx, %rax
	jbe	LBB0_13
## %bb.12:
	subq	%rcx, %r13
	addq	%rax, %r13
LBB0_14:
	movq	%r13, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_MEM_TO_DEV,4,2             ## @DMA_MEM_TO_DEV
	.no_dead_strip	_fsl_edma_desc_residue
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fsl_edma_desc_residue
_fsl_edma_desc_residue:                 ; @fsl_edma_desc_residue
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x21, x2
	mov	x19, x0
	ldp	x23, x27, [x0]
	ldr	x26, [x0, #16]
	ldp	w24, w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.1:
	mov	x25, #0
	mov	x20, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x23, #8]
	lsl	x28, x25, #3
	ldr	x8, [x8, x28]
	ldr	w0, [x8, #12]
	bl	_le32_to_cpu
	mov	x22, x0
	ldr	x8, [x23, #8]
	ldr	x8, [x8, x28]
	ldr	w0, [x8, #8]
	bl	_le16_to_cpu
	madd	x20, x0, x22, x20
	add	x25, x25, #1
	ldr	x8, [x19]
	ldrsw	x8, [x8, #4]
	cmp	x25, x8
	b.lt	LBB0_2
; %bb.3:
	cbnz	w21, LBB0_5
	b	LBB0_13
LBB0_4:
	mov	x20, #0
	cbz	w21, LBB0_13
LBB0_5:
Lloh0:
	adrp	x25, _DMA_MEM_TO_DEV@GOTPAGE
Lloh1:
	ldr	x25, [x25, _DMA_MEM_TO_DEV@GOTPAGEOFF]
	ldr	w9, [x25]
	ldr	x0, [x19, #8]
	ldr	x8, [x27]
	cmp	w24, w9
	b.ne	LBB0_7
; %bb.6:
	add	x8, x8, x26, lsl #3
	add	x1, x8, #4
	b	LBB0_8
LBB0_7:
	add	x1, x8, x26, lsl #3
LBB0_8:
	bl	_edma_readl
	mov	x21, x0
	ldr	x8, [x19]
	ldr	w8, [x8, #4]
	cmp	w8, #1
	b.lt	LBB0_13
; %bb.9:
	mov	x26, #0
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x23, #8]
	lsl	x27, x26, #3
	ldr	x8, [x8, x27]
	ldr	w0, [x8, #12]
	bl	_le32_to_cpu
	mov	x22, x0
	ldr	x8, [x23, #8]
	ldr	x8, [x8, x27]
	ldr	w0, [x8, #8]
	bl	_le16_to_cpu
	mul	x22, x0, x22
	ldr	w8, [x25]
	cmp	w24, w8
	cset	w8, eq
	ldr	x9, [x23, #8]
	ldr	x9, [x9, x27]
	ldr	w0, [x9, w8, uxtw #2]
	bl	_le32_to_cpu
	sub	x20, x20, x22
	add	x8, x0, x22
	cmp	x21, x0
	ccmp	x8, x21, #0, hs
	b.hi	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	add	x26, x26, #1
	ldr	x8, [x19]
	ldrsw	x8, [x8, #4]
	cmp	x26, x8
	b.lt	LBB0_10
	b	LBB0_13
LBB0_12:
	sub	x9, x20, x21
	add	x20, x9, x8
LBB0_13:
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_MEM_TO_DEV,4,2             ; @DMA_MEM_TO_DEV
	.no_dead_strip	_fsl_edma_desc_residue
.subsections_via_symbols
