	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rtl8366s_sw_set_port_led
_rtl8366s_sw_set_port_led:              ## @rtl8366s_sw_set_port_led
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdx, %rbx
	callq	_sw_to_rtl8366_smi
	movl	(%rbx), %edx
	movq	_RTL8366S_NUM_PORTS@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %edx
	jge	LBB0_2
## %bb.1:
	movl	$1, %esi
	movl	%edx, %ecx
	shll	%cl, %esi
	movq	_RTL8366S_PORT_UNKNOWN@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %esi
	jne	LBB0_3
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_3:
	leal	(,%rdx,4), %ecx
	movl	$15, %esi
	shll	%cl, %esi
	movq	_RTL8366S_PORT_NUM_CPU@GOTPCREL(%rip), %rdi
	cmpl	(%rdi), %edx
	movl	$240, %edx
	cmovnel	%esi, %edx
	movl	4(%rbx), %ebx
	movl	$4, %esi
	cmovnel	%ecx, %esi
	movq	_RTL8366S_LED_CTRL_REG@GOTPCREL(%rip), %rdi
	cmoveq	_RTL8366S_LED_BLINKRATE_REG@GOTPCREL(%rip), %rdi
	movl	%esi, %ecx
	shll	%cl, %ebx
	movl	(%rdi), %esi
	movq	%rax, %rdi
	movl	%ebx, %ecx
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_rtl8366_smi_rmwr               ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_RTL8366S_NUM_PORTS,4,2         ## @RTL8366S_NUM_PORTS
	.comm	_RTL8366S_PORT_UNKNOWN,4,2      ## @RTL8366S_PORT_UNKNOWN
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_RTL8366S_PORT_NUM_CPU,4,2      ## @RTL8366S_PORT_NUM_CPU
	.comm	_RTL8366S_LED_BLINKRATE_REG,4,2 ## @RTL8366S_LED_BLINKRATE_REG
	.comm	_RTL8366S_LED_CTRL_REG,4,2      ## @RTL8366S_LED_CTRL_REG
	.no_dead_strip	_rtl8366s_sw_set_port_led
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rtl8366s_sw_set_port_led
_rtl8366s_sw_set_port_led:              ; @rtl8366s_sw_set_port_led
	.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	x19, x2
	bl	_sw_to_rtl8366_smi
	ldr	w8, [x19]
Lloh0:
	adrp	x9, _RTL8366S_NUM_PORTS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _RTL8366S_NUM_PORTS@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ge	LBB0_2
; %bb.1:
	mov	w9, #1
	lsl	w9, w9, w8
Lloh3:
	adrp	x10, _RTL8366S_PORT_UNKNOWN@GOTPAGE
Lloh4:
	ldr	x10, [x10, _RTL8366S_PORT_UNKNOWN@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	cmp	w9, w10
	b.ne	LBB0_3
LBB0_2:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	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_3:
Lloh9:
	adrp	x9, _RTL8366S_PORT_NUM_CPU@GOTPAGE
Lloh10:
	ldr	x9, [x9, _RTL8366S_PORT_NUM_CPU@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	lsl	w10, w8, #2
	mov	w11, #15
	lsl	w11, w11, w10
	mov	w12, #4
	cmp	w8, w9
	csel	w8, w12, w10, eq
	mov	w9, #240
	csel	w2, w9, w11, eq
	ldr	w9, [x19, #4]
	lsl	w3, w9, w8
Lloh12:
	adrp	x8, _RTL8366S_LED_BLINKRATE_REG@GOTPAGE
Lloh13:
	ldr	x8, [x8, _RTL8366S_LED_BLINKRATE_REG@GOTPAGEOFF]
Lloh14:
	adrp	x9, _RTL8366S_LED_CTRL_REG@GOTPAGE
Lloh15:
	ldr	x9, [x9, _RTL8366S_LED_CTRL_REG@GOTPAGEOFF]
	csel	x8, x8, x9, eq
	ldr	w1, [x8]
	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 AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_RTL8366S_NUM_PORTS,4,2         ; @RTL8366S_NUM_PORTS
	.comm	_RTL8366S_PORT_UNKNOWN,4,2      ; @RTL8366S_PORT_UNKNOWN
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_RTL8366S_PORT_NUM_CPU,4,2      ; @RTL8366S_PORT_NUM_CPU
	.comm	_RTL8366S_LED_BLINKRATE_REG,4,2 ; @RTL8366S_LED_BLINKRATE_REG
	.comm	_RTL8366S_LED_CTRL_REG,4,2      ; @RTL8366S_LED_CTRL_REG
	.no_dead_strip	_rtl8366s_sw_set_port_led
.subsections_via_symbols
