	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ar8xxx_sw_get_port_stats       ## -- Begin function ar8xxx_sw_get_port_stats
	.p2align	4, 0x90
_ar8xxx_sw_get_port_stats:              ## @ar8xxx_sw_get_port_stats
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movl	%esi, %r15d
	movq	%rdi, %r12
	callq	_swdev_to_ar8xxx
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_ar8xxx_has_mib_counters
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	cmpl	$0, 24(%rbx)
	je	LBB0_2
## %bb.4:
	movq	16(%rbx), %rax
	cmpq	$0, (%rax)
	jne	LBB0_6
## %bb.5:
	cmpq	$0, 8(%rax)
	je	LBB0_2
LBB0_6:
	cmpl	%r15d, (%r12)
	jle	LBB0_7
## %bb.8:
	movq	%rbx, %r12
	addq	$8, %r12
	movq	%r12, %rdi
	callq	_mutex_lock
	movq	16(%rbx), %rax
	movslq	16(%rax), %rcx
	movslq	%r15d, %rdx
	imulq	%rcx, %rdx
	shlq	$3, %rdx
	addq	(%rbx), %rdx
	movq	8(%rax), %rcx
	movq	(%rdx,%rcx,8), %rcx
	movq	%rcx, 8(%r14)
	movq	(%rax), %rax
	movq	(%rdx,%rax,8), %rax
	movq	%rax, (%r14)
	movq	%r12, %rdi
	callq	_mutex_unlock
	xorl	%eax, %eax
	jmp	LBB0_9
LBB0_2:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_7:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_3:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_9:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ar8xxx_sw_get_port_stats       ; -- Begin function ar8xxx_sw_get_port_stats
	.p2align	2
_ar8xxx_sw_get_port_stats:              ; @ar8xxx_sw_get_port_stats
	.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, x2
	mov	x20, x1
	mov	x22, x0
	bl	_swdev_to_ar8xxx
	mov	x21, x0
	bl	_ar8xxx_has_mib_counters
	cbz	w0, LBB0_6
; %bb.1:
	ldr	w8, [x21, #24]
	cbz	w8, LBB0_6
; %bb.2:
	ldr	x8, [x21, #16]
	ldr	x9, [x8]
	cbnz	x9, LBB0_4
; %bb.3:
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_6
LBB0_4:
	ldr	w8, [x22]
	cmp	w8, w20
	b.le	LBB0_7
; %bb.5:
	add	x22, x21, #8
	mov	x0, x22
	bl	_mutex_lock
	ldr	x8, [x21]
	ldr	x9, [x21, #16]
	ldr	w10, [x9, #16]
	mul	w10, w10, w20
	add	x8, x8, w10, sxtw #3
	ldp	x9, x10, [x9]
	ldr	x10, [x8, x10, lsl #3]
	str	x10, [x19, #8]
	ldr	x8, [x8, x9, lsl #3]
	str	x8, [x19]
	mov	x0, x22
	bl	_mutex_unlock
	mov	w0, #0
	b	LBB0_9
LBB0_6:
Lloh0:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
