	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rtl8366rb_sw_get_port_rate_in
_rtl8366rb_sw_get_port_rate_in:         ## @rtl8366rb_sw_get_port_rate_in
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdx, %rbx
	callq	_sw_to_rtl8366_smi
	movq	%rax, %r14
	movq	(%rbx), %rdi
	movq	_RTL8366RB_NUM_PORTS@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdi
	jge	LBB0_1
## %bb.2:
	callq	_RTL8366RB_IB_REG
	leaq	-20(%rbp), %rdx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_rtl8366_smi_read_reg
	movq	_RTL8366RB_IB_BDTH_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	-20(%rbp), %ecx
	andl	%eax, %ecx
	xorl	%edx, %edx
	cmpl	%eax, %ecx
	setl	%dl
	addl	%ecx, %edx
	movq	_RTL8366RB_BDTH_UNIT@GOTPCREL(%rip), %rax
	imull	(%rax), %edx
	movl	%edx, 8(%rbx)
	xorl	%eax, %eax
	jmp	LBB0_3
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_3:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RTL8366RB_NUM_PORTS,8,3        ## @RTL8366RB_NUM_PORTS
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_RTL8366RB_IB_BDTH_MASK,4,2     ## @RTL8366RB_IB_BDTH_MASK
	.comm	_RTL8366RB_BDTH_UNIT,4,2        ## @RTL8366RB_BDTH_UNIT
	.no_dead_strip	_rtl8366rb_sw_get_port_rate_in
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rtl8366rb_sw_get_port_rate_in
_rtl8366rb_sw_get_port_rate_in:         ; @rtl8366rb_sw_get_port_rate_in
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x2
	bl	_sw_to_rtl8366_smi
	mov	x20, x0
	ldr	x0, [x19]
Lloh0:
	adrp	x8, _RTL8366RB_NUM_PORTS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RTL8366RB_NUM_PORTS@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ge	LBB0_2
; %bb.1:
	bl	_RTL8366RB_IB_REG
	mov	x1, x0
	add	x2, sp, #12
	mov	x0, x20
	bl	_rtl8366_smi_read_reg
	mov	w0, #0
Lloh3:
	adrp	x8, _RTL8366RB_IB_BDTH_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RTL8366RB_IB_BDTH_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ldr	w9, [sp, #12]
	and	w9, w9, w8
	cmp	w9, w8
	cinc	w8, w9, lt
Lloh6:
	adrp	x9, _RTL8366RB_BDTH_UNIT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _RTL8366RB_BDTH_UNIT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	mul	w8, w8, w9
	str	w8, [x19, #8]
	b	LBB0_3
LBB0_2:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_RTL8366RB_NUM_PORTS,8,3        ; @RTL8366RB_NUM_PORTS
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_RTL8366RB_IB_BDTH_MASK,4,2     ; @RTL8366RB_IB_BDTH_MASK
	.comm	_RTL8366RB_BDTH_UNIT,4,2        ; @RTL8366RB_BDTH_UNIT
	.no_dead_strip	_rtl8366rb_sw_get_port_rate_in
.subsections_via_symbols
