	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_get_rx_ring
_mtk_get_rx_ring:                       ## @mtk_get_rx_ring
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	cmpl	$0, 8(%rdi)
	je	LBB0_8
## %bb.1:
	movq	_MTK_MAX_RX_RING_NUM@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_6
## %bb.2:
	movq	_RX_DMA_DONE@GOTPCREL(%rip), %r13
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %r15
	movl	16(%r15,%rbx), %esi
	movl	20(%r15,%rbx), %edi
	callq	_NEXT_DESP_IDX
	movq	8(%r15,%rbx), %rcx
	cltq
	movl	(%r13), %edx
	testl	%edx, (%rcx,%rax,4)
	jne	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	incq	%r14
	movq	_MTK_MAX_RX_RING_NUM@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	addq	$24, %rbx
	cmpq	%rax, %r14
	jl	LBB0_3
LBB0_6:
	xorl	%eax, %eax
	jmp	LBB0_7
LBB0_8:
	movq	(%r12), %rax
	jmp	LBB0_7
LBB0_4:
	leaq	(%r15,%rbx), %rax
	movl	$1, (%r15,%rbx)
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MTK_MAX_RX_RING_NUM,4,2        ## @MTK_MAX_RX_RING_NUM
	.comm	_RX_DMA_DONE,4,2                ## @RX_DMA_DONE
	.no_dead_strip	_mtk_get_rx_ring
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_get_rx_ring
_mtk_get_rx_ring:                       ; @mtk_get_rx_ring
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	ldr	w8, [x0, #8]
	cbz	w8, LBB0_6
; %bb.1:
Lloh0:
	adrp	x21, _MTK_MAX_RX_RING_NUM@GOTPAGE
Lloh1:
	ldr	x21, [x21, _MTK_MAX_RX_RING_NUM@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.2:
	mov	x22, #0
	mov	x23, #0
Lloh2:
	adrp	x24, _RX_DMA_DONE@GOTPAGE
Lloh3:
	ldr	x24, [x24, _RX_DMA_DONE@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19]
	add	x20, x8, x22
	ldp	w1, w0, [x20, #16]
	bl	_NEXT_DESP_IDX
	ldr	x8, [x20, #8]
	ldr	w8, [x8, w0, sxtw #2]
	ldr	w9, [x24]
	tst	w9, w8
	b.ne	LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x23, x23, #1
	ldrsw	x8, [x21]
	add	x22, x22, #24
	cmp	x23, x8
	b.lt	LBB0_3
LBB0_5:
	mov	x20, #0
	b	LBB0_8
LBB0_6:
	ldr	x20, [x19]
	b	LBB0_8
LBB0_7:
	mov	w8, #1
	str	w8, [x20]
LBB0_8:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_MTK_MAX_RX_RING_NUM,4,2        ; @MTK_MAX_RX_RING_NUM
	.comm	_RX_DMA_DONE,4,2                ; @RX_DMA_DONE
	.no_dead_strip	_mtk_get_rx_ring
.subsections_via_symbols
