	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function st_fdma_desc_residue
_st_fdma_desc_residue:                  ## @st_fdma_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movq	(%rdi), %rbx
	testl	%edx, %edx
	je	LBB0_1
## %bb.2:
	movq	_FDMA_CH_CMD_OFST@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_fchan_read
	movq	_FDMA_CH_CMD_DATA_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	(%r14), %rcx
	jmp	LBB0_3
LBB0_1:
	xorl	%eax, %eax
	movq	%rbx, %rcx
LBB0_3:
	movl	(%rcx), %ecx
	testl	%ecx, %ecx
	jle	LBB0_4
## %bb.5:
	movq	8(%rbx), %rdx
	incq	%rcx
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	leal	-2(%rcx), %esi
	shlq	$4, %rsi
	cmpl	8(%rdx,%rsi), %eax
	je	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	(%rdx,%rsi), %rsi
	addq	(%rsi), %rbx
	decq	%rcx
	cmpq	$1, %rcx
	ja	LBB0_6
	jmp	LBB0_9
LBB0_4:
	xorl	%ebx, %ebx
	jmp	LBB0_9
LBB0_7:
	movq	_FDMA_CNTN_OFST@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_fnode_read
	addq	%rax, %rbx
LBB0_9:
	movq	%rbx, %rax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FDMA_CH_CMD_OFST,4,2           ## @FDMA_CH_CMD_OFST
	.comm	_FDMA_CH_CMD_DATA_MASK,4,2      ## @FDMA_CH_CMD_DATA_MASK
	.comm	_FDMA_CNTN_OFST,4,2             ## @FDMA_CNTN_OFST
	.no_dead_strip	_st_fdma_desc_residue
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function st_fdma_desc_residue
_st_fdma_desc_residue:                  ; @st_fdma_desc_residue
	.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	x19, x0
	ldr	x21, [x0]
	cbz	w2, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _FDMA_CH_CMD_OFST@GOTPAGE
Lloh1:
	ldr	x8, [x8, _FDMA_CH_CMD_OFST@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_fchan_read
Lloh3:
	adrp	x8, _FDMA_CH_CMD_DATA_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _FDMA_CH_CMD_DATA_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	and	w8, w8, w0
	ldr	x9, [x19]
	b	LBB0_3
LBB0_2:
	mov	w8, #0
	mov	x9, x21
LBB0_3:
	ldr	w10, [x9]
	cmp	w10, #1
	b.lt	LBB0_7
; %bb.4:
	mov	x20, #0
	ldr	x9, [x21, #8]
	add	x10, x10, #1
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	sub	w11, w10, #2
	add	x12, x9, w11, uxtw #4
	ldr	w12, [x12, #8]
	cmp	w8, w12
	b.eq	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	lsl	x11, x11, #4
	ldr	x11, [x9, x11]
	ldr	x11, [x11]
	add	x20, x11, x20
	sub	x10, x10, #1
	cmp	x10, #1
	b.hi	LBB0_5
	b	LBB0_9
LBB0_7:
	mov	x20, #0
	b	LBB0_9
LBB0_8:
Lloh6:
	adrp	x8, _FDMA_CNTN_OFST@GOTPAGE
Lloh7:
	ldr	x8, [x8, _FDMA_CNTN_OFST@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_fnode_read
	add	x20, x0, x20
LBB0_9:
	mov	x0, x20
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_FDMA_CH_CMD_OFST,4,2           ; @FDMA_CH_CMD_OFST
	.comm	_FDMA_CH_CMD_DATA_MASK,4,2      ; @FDMA_CH_CMD_DATA_MASK
	.comm	_FDMA_CNTN_OFST,4,2             ; @FDMA_CNTN_OFST
	.no_dead_strip	_st_fdma_desc_residue
.subsections_via_symbols
