	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sun6i_get_chan_size
_sun6i_get_chan_size:                   ## @sun6i_get_chan_size
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	8(%rdi), %r15
	movq	_DMA_CHAN_LLI_ADDR@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r14), %rdi
	callq	_readl
	movq	%rax, %rbx
	movq	_DMA_CHAN_CUR_CNT@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r14), %rdi
	callq	_readl
	movq	_LLI_LAST_ITEM@GOTPCREL(%rip), %rcx
	cmpq	%rbx, (%rcx)
	je	LBB0_6
## %bb.1:
	movq	(%r15), %rcx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	testq	%rcx, %rcx
	je	LBB0_6
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rcx, %rdx
	movq	16(%rcx), %rcx
	cmpq	%rbx, (%rdx)
	jne	LBB0_2
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_4 Depth=1
	addq	8(%rcx), %rax
	movq	16(%rcx), %rcx
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	testq	%rcx, %rcx
	jne	LBB0_5
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_CHAN_LLI_ADDR,8,3          ## @DMA_CHAN_LLI_ADDR
	.comm	_DMA_CHAN_CUR_CNT,8,3           ## @DMA_CHAN_CUR_CNT
	.comm	_LLI_LAST_ITEM,8,3              ## @LLI_LAST_ITEM
	.no_dead_strip	_sun6i_get_chan_size
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sun6i_get_chan_size
_sun6i_get_chan_size:                   ; @sun6i_get_chan_size
	.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	x20, x0
	ldp	x8, x21, [x0]
Lloh0:
	adrp	x9, _DMA_CHAN_LLI_ADDR@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DMA_CHAN_LLI_ADDR@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl
	mov	x19, x0
	ldr	x8, [x20]
Lloh3:
	adrp	x9, _DMA_CHAN_CUR_CNT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _DMA_CHAN_CUR_CNT@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl
Lloh6:
	adrp	x8, _LLI_LAST_ITEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _LLI_LAST_ITEM@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	cmp	x8, x19
	b.eq	LBB0_6
; %bb.1:
	ldr	x8, [x21]
	cbz	x8, LBB0_6
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x8]
	ldr	x8, [x8, #16]
	cmp	x9, x19
	b.eq	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	cbnz	x8, LBB0_2
	b	LBB0_6
LBB0_4:
	cbz	x8, LBB0_6
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldp	x9, x8, [x8, #8]
	add	x0, x9, x0
	cbnz	x8, LBB0_5
LBB0_6:
	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	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_CHAN_LLI_ADDR,8,3          ; @DMA_CHAN_LLI_ADDR
	.comm	_DMA_CHAN_CUR_CNT,8,3           ; @DMA_CHAN_CUR_CNT
	.comm	_LLI_LAST_ITEM,8,3              ; @LLI_LAST_ITEM
	.no_dead_strip	_sun6i_get_chan_size
.subsections_via_symbols
