	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rtl8367_sw_reset_port_mibs
_rtl8367_sw_reset_port_mibs:            ## @rtl8367_sw_reset_port_mibs
	.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, %rbx
	callq	_sw_to_rtl8366_smi
	movq	%rax, %r14
	movl	(%rbx), %ebx
	movq	_RTL8367_NUM_PORTS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jge	LBB0_1
## %bb.2:
	leal	7(%rbx), %r12d
	testl	%ebx, %ebx
	cmovnsl	%ebx, %r12d
	movl	%r12d, %edi
	sarl	$3, %edi
	callq	_RTL8367_MIB_CTRL_REG
	movl	%eax, %r15d
	andl	$-8, %r12d
	subl	%r12d, %ebx
	movl	%ebx, %edi
	callq	_RTL8367_MIB_CTRL_PORT_RESET_MASK
	movq	%r14, %rdi
	movl	%r15d, %esi
	xorl	%edx, %edx
	movl	%eax, %ecx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_rtl8366_smi_rmwr               ## TAILCALL
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RTL8367_NUM_PORTS,4,2          ## @RTL8367_NUM_PORTS
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_rtl8367_sw_reset_port_mibs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rtl8367_sw_reset_port_mibs
_rtl8367_sw_reset_port_mibs:            ; @rtl8367_sw_reset_port_mibs
	.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	x20, x2
	bl	_sw_to_rtl8366_smi
	ldr	w21, [x20]
Lloh0:
	adrp	x8, _RTL8367_NUM_PORTS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RTL8367_NUM_PORTS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w21, w8
	b.ge	LBB0_2
; %bb.1:
	mov	x19, x0
	add	w8, w21, #7
	cmp	w21, #0
	csel	w22, w8, w21, lt
	asr	w0, w22, #3
	bl	_RTL8367_MIB_CTRL_REG
	mov	x20, x0
	and	w8, w22, #0xfffffff8
	sub	w0, w21, w8
	bl	_RTL8367_MIB_CTRL_PORT_RESET_MASK
	mov	x3, x0
	mov	x0, x19
	mov	x1, x20
	mov	w2, #0
	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
	b	_rtl8366_smi_rmwr
LBB0_2:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_RTL8367_NUM_PORTS,4,2          ; @RTL8367_NUM_PORTS
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_rtl8367_sw_reset_port_mibs
.subsections_via_symbols
