	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rtl8367b_get_mib_counter
_rtl8367b_get_mib_counter:              ## @rtl8367b_get_mib_counter
	.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
	movq	_RTL8367B_NUM_PORTS@GOTPCREL(%rip), %rax
	cmpl	%edx, (%rax)
	jl	LBB0_4
## %bb.1:
	movq	_RTL8367B_NUM_MIB_COUNTERS@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jle	LBB0_4
## %bb.2:
	movq	%rcx, %r13
	movq	%rdi, %r15
	movq	_rtl8367b_mib_counters@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	movslq	%esi, %r14
	movq	_RTL8367B_MIB_COUNTER_PORT_OFFSET@GOTPCREL(%rip), %rax
	imull	(%rax), %edx
	addl	(%r12,%r14,8), %edx
	movq	_RTL8367B_MIB_ADDRESS_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	sarl	$2, %edx
	callq	_REG_WR
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	callq	_RTL8367B_MIB_CTRL0_REG
	leaq	-44(%rbp), %rdx
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_REG_RD
	movl	-44(%rbp), %eax
	movq	_RTL8367B_MIB_CTRL0_BUSY_MASK@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_8
## %bb.3:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_5:
	xorl	%ebx, %ebx
LBB0_6:
	subl	(%rax), %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	_RTL8367B_MIB_CTRL0_RESET_MASK@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_10
## %bb.9:
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_10:
	movl	4(%r12,%r14,8), %ecx
	movl	$3, %ebx
	cmpl	$4, %ecx
	je	LBB0_13
## %bb.11:
	movl	(%r12,%r14,8), %eax
	leal	1(%rax), %esi
	leal	4(%rax), %edx
	testl	%esi, %esi
	cmovnsl	%esi, %edx
	testl	%ecx, %ecx
	jle	LBB0_17
## %bb.12:
	andl	$-4, %edx
	negl	%edx
	leal	(%rax,%rdx), %ebx
	incl	%ebx
LBB0_13:
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	%r12, %r14
	xorl	%r12d, %r12d
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	callq	_RTL8367B_MIB_COUNTER_REG
	movq	%r15, %rdi
	movl	%eax, %esi
	leaq	-44(%rbp), %rdx
	callq	_REG_RD
	shll	$16, %r12d
	movzwl	-44(%rbp), %eax
	movslq	%r12d, %r12
	orq	%rax, %r12
	incl	%r13d
	decl	%ebx
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmpl	4(%r14,%rax,8), %r13d
	jl	LBB0_14
## %bb.15:
	movq	-56(%rbp), %r13                 ## 8-byte Reload
LBB0_16:
	movq	%r12, (%r13)
	xorl	%ebx, %ebx
	jmp	LBB0_7
LBB0_17:
	xorl	%r12d, %r12d
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_RTL8367B_NUM_PORTS,4,2         ## @RTL8367B_NUM_PORTS
	.comm	_RTL8367B_NUM_MIB_COUNTERS,4,2  ## @RTL8367B_NUM_MIB_COUNTERS
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_rtl8367b_mib_counters,8,3      ## @rtl8367b_mib_counters
	.comm	_RTL8367B_MIB_COUNTER_PORT_OFFSET,4,2 ## @RTL8367B_MIB_COUNTER_PORT_OFFSET
	.comm	_RTL8367B_MIB_ADDRESS_REG,4,2   ## @RTL8367B_MIB_ADDRESS_REG
	.comm	_RTL8367B_MIB_CTRL0_BUSY_MASK,4,2 ## @RTL8367B_MIB_CTRL0_BUSY_MASK
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_RTL8367B_MIB_CTRL0_RESET_MASK,4,2 ## @RTL8367B_MIB_CTRL0_RESET_MASK
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_rtl8367b_get_mib_counter
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rtl8367b_get_mib_counter
_rtl8367b_get_mib_counter:              ; @rtl8367b_get_mib_counter
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
Lloh0:
	adrp	x8, _RTL8367B_NUM_PORTS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RTL8367B_NUM_PORTS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _RTL8367B_NUM_MIB_COUNTERS@GOTPAGE
Lloh4:
	ldr	x9, [x9, _RTL8367B_NUM_MIB_COUNTERS@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w2
	ccmp	w9, w1, #4, ge
	b.gt	LBB0_2
; %bb.1:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_6
LBB0_2:
	mov	x19, x3
	mov	x21, x1
	mov	x20, x0
Lloh8:
	adrp	x8, _rtl8367b_mib_counters@GOTPAGE
Lloh9:
	ldr	x8, [x8, _rtl8367b_mib_counters@GOTPAGEOFF]
Lloh10:
	ldr	x22, [x8]
Lloh11:
	adrp	x8, _RTL8367B_MIB_COUNTER_PORT_OFFSET@GOTPAGE
Lloh12:
	ldr	x8, [x8, _RTL8367B_MIB_COUNTER_PORT_OFFSET@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	add	x23, x22, w1, sxtw #3
	ldr	w9, [x23]
	madd	w8, w8, w2, w9
Lloh14:
	adrp	x9, _RTL8367B_MIB_ADDRESS_REG@GOTPAGE
Lloh15:
	ldr	x9, [x9, _RTL8367B_MIB_ADDRESS_REG@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x9]
	asr	w2, w8, #2
	bl	_REG_WR
	mov	w0, #0
	bl	_RTL8367B_MIB_CTRL0_REG
	mov	x1, x0
	add	x2, sp, #12
	mov	x0, x20
	bl	_REG_RD
	ldr	w8, [sp, #12]
Lloh17:
	adrp	x9, _RTL8367B_MIB_CTRL0_BUSY_MASK@GOTPAGE
Lloh18:
	ldr	x9, [x9, _RTL8367B_MIB_CTRL0_BUSY_MASK@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
Lloh20:
	adrp	x8, _EBUSY@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:
Lloh22:
	adrp	x9, _RTL8367B_MIB_CTRL0_RESET_MASK@GOTPAGE
Lloh23:
	ldr	x9, [x9, _RTL8367B_MIB_CTRL0_RESET_MASK@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.5:
Lloh25:
	adrp	x8, _EIO@GOTPAGE
Lloh26:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	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
	add	sp, sp, #80
	ret
LBB0_8:
	sxtw	x8, w21
	add	x22, x22, x8, lsl #3
	ldr	w8, [x22, #4]!
	cmp	w8, #4
	b.ne	LBB0_10
; %bb.9:
	mov	w21, #3
	b	LBB0_11
LBB0_10:
	ldr	w9, [x23]
	add	w9, w9, #1
	negs	w10, w9
	and	w10, w10, #0x3
	and	w9, w9, #0x3
	csneg	w21, w9, w10, mi
	cmp	w8, #1
	b.lt	LBB0_13
LBB0_11:
	mov	w23, #0
	mov	w24, #0
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_RTL8367B_MIB_COUNTER_REG
	mov	x1, x0
	add	x2, sp, #12
	mov	x0, x20
	bl	_REG_RD
	lsl	w8, w23, #16
	ldrh	w9, [sp, #12]
	sxtw	x8, w8
	orr	x23, x9, x8
	add	w24, w24, #1
	ldr	w8, [x22]
	sub	w21, w21, #1
	cmp	w24, w8
	b.lt	LBB0_12
	b	LBB0_14
LBB0_13:
	mov	x23, #0
LBB0_14:
	mov	w0, #0
	str	x23, [x19]
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_RTL8367B_NUM_PORTS,4,2         ; @RTL8367B_NUM_PORTS
	.comm	_RTL8367B_NUM_MIB_COUNTERS,4,2  ; @RTL8367B_NUM_MIB_COUNTERS
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_rtl8367b_mib_counters,8,3      ; @rtl8367b_mib_counters
	.comm	_RTL8367B_MIB_COUNTER_PORT_OFFSET,4,2 ; @RTL8367B_MIB_COUNTER_PORT_OFFSET
	.comm	_RTL8367B_MIB_ADDRESS_REG,4,2   ; @RTL8367B_MIB_ADDRESS_REG
	.comm	_RTL8367B_MIB_CTRL0_BUSY_MASK,4,2 ; @RTL8367B_MIB_CTRL0_BUSY_MASK
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_RTL8367B_MIB_CTRL0_RESET_MASK,4,2 ; @RTL8367B_MIB_CTRL0_RESET_MASK
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_rtl8367b_get_mib_counter
.subsections_via_symbols
