	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rtl8366rb_sw_set_port_rate_in
_rtl8366rb_sw_set_port_rate_in:         ## @rtl8366rb_sw_set_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	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	callq	_sw_to_rtl8366_smi
	movq	%rax, %r14
	movq	(%r15), %rdi
	movq	_RTL8366RB_NUM_PORTS@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdi
	jge	LBB0_6
## %bb.1:
	movl	8(%r15), %eax
	testl	%eax, %eax
	jle	LBB0_4
## %bb.2:
	movq	_RTL8366RB_BDTH_SW_MAX@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jge	LBB0_4
## %bb.3:
	decl	%eax
	movq	_RTL8366RB_BDTH_UNIT@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
	jmp	LBB0_5
LBB0_6:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	_RTL8366RB_BDTH_REG_DEFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_5:
	movl	%eax, 8(%r15)
	callq	_RTL8366RB_IB_REG
	movq	_RTL8366RB_IB_BDTH_MASK@GOTPCREL(%rip), %rsi
	movq	_RTL8366RB_IB_PREIFG_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_RTL8366RB_IB_PREIFG_OFFSET@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movq	_RTL8366RB_QOS_DEFAULT_PREIFG@GOTPCREL(%rip), %rdi
	movl	(%rdi), %ebx
	shll	%cl, %ebx
	orl	(%rsi), %edx
	orl	8(%r15), %ebx
	movq	%r14, %rdi
	movl	%eax, %esi
	movl	%ebx, %ecx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_rtl8366_smi_rmwr               ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_RTL8366RB_NUM_PORTS,8,3        ## @RTL8366RB_NUM_PORTS
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_RTL8366RB_BDTH_SW_MAX,4,2      ## @RTL8366RB_BDTH_SW_MAX
	.comm	_RTL8366RB_BDTH_UNIT,4,2        ## @RTL8366RB_BDTH_UNIT
	.comm	_RTL8366RB_BDTH_REG_DEFAULT,4,2 ## @RTL8366RB_BDTH_REG_DEFAULT
	.comm	_RTL8366RB_IB_BDTH_MASK,4,2     ## @RTL8366RB_IB_BDTH_MASK
	.comm	_RTL8366RB_IB_PREIFG_MASK,4,2   ## @RTL8366RB_IB_PREIFG_MASK
	.comm	_RTL8366RB_QOS_DEFAULT_PREIFG,4,2 ## @RTL8366RB_QOS_DEFAULT_PREIFG
	.comm	_RTL8366RB_IB_PREIFG_OFFSET,4,2 ## @RTL8366RB_IB_PREIFG_OFFSET
	.no_dead_strip	_rtl8366rb_sw_set_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_set_port_rate_in
_rtl8366rb_sw_set_port_rate_in:         ; @rtl8366rb_sw_set_port_rate_in
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x2
	bl	_sw_to_rtl8366_smi
	mov	x19, x0
	ldr	x0, [x20]
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_3
; %bb.1:
	ldr	w9, [x20, #8]
Lloh3:
	adrp	x8, _RTL8366RB_BDTH_SW_MAX@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RTL8366RB_BDTH_SW_MAX@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x8]
	subs	w8, w9, #1
	ccmp	w9, w10, #0, ge
	b.lt	LBB0_4
; %bb.2:
Lloh6:
	adrp	x8, _RTL8366RB_BDTH_REG_DEFAULT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _RTL8366RB_BDTH_REG_DEFAULT@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	b	LBB0_5
LBB0_3:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_4:
Lloh12:
	adrp	x9, _RTL8366RB_BDTH_UNIT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _RTL8366RB_BDTH_UNIT@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	sdiv	w8, w8, w9
LBB0_5:
	str	w8, [x20, #8]
	bl	_RTL8366RB_IB_REG
	mov	x1, x0
Lloh15:
	adrp	x8, _RTL8366RB_IB_BDTH_MASK@GOTPAGE
Lloh16:
	ldr	x8, [x8, _RTL8366RB_IB_BDTH_MASK@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
Lloh18:
	adrp	x9, _RTL8366RB_IB_PREIFG_MASK@GOTPAGE
Lloh19:
	ldr	x9, [x9, _RTL8366RB_IB_PREIFG_MASK@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	orr	w2, w9, w8
	ldr	w8, [x20, #8]
Lloh21:
	adrp	x9, _RTL8366RB_QOS_DEFAULT_PREIFG@GOTPAGE
Lloh22:
	ldr	x9, [x9, _RTL8366RB_QOS_DEFAULT_PREIFG@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
Lloh24:
	adrp	x10, _RTL8366RB_IB_PREIFG_OFFSET@GOTPAGE
Lloh25:
	ldr	x10, [x10, _RTL8366RB_IB_PREIFG_OFFSET@GOTPAGEOFF]
Lloh26:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	orr	w3, w9, w8
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_rtl8366_smi_rmwr
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_RTL8366RB_NUM_PORTS,8,3        ; @RTL8366RB_NUM_PORTS
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_RTL8366RB_BDTH_SW_MAX,4,2      ; @RTL8366RB_BDTH_SW_MAX
	.comm	_RTL8366RB_BDTH_UNIT,4,2        ; @RTL8366RB_BDTH_UNIT
	.comm	_RTL8366RB_BDTH_REG_DEFAULT,4,2 ; @RTL8366RB_BDTH_REG_DEFAULT
	.comm	_RTL8366RB_IB_BDTH_MASK,4,2     ; @RTL8366RB_IB_BDTH_MASK
	.comm	_RTL8366RB_IB_PREIFG_MASK,4,2   ; @RTL8366RB_IB_PREIFG_MASK
	.comm	_RTL8366RB_QOS_DEFAULT_PREIFG,4,2 ; @RTL8366RB_QOS_DEFAULT_PREIFG
	.comm	_RTL8366RB_IB_PREIFG_OFFSET,4,2 ; @RTL8366RB_IB_PREIFG_OFFSET
	.no_dead_strip	_rtl8366rb_sw_set_port_rate_in
.subsections_via_symbols
