	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rtl8366s_set_green_port
_rtl8366s_set_green_port:               ## @rtl8366s_set_green_port
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_RTL8366S_NUM_PORTS@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jle	LBB0_1
## %bb.2:
	movl	%edx, %r15d
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	_RTL8366S_PHY_POWER_SAVING_CTRL_REG@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	leaq	-36(%rbp), %r8
	xorl	%edx, %edx
	callq	_rtl8366s_read_phy_reg
	testl	%eax, %eax
	jne	LBB0_7
## %bb.3:
	movq	_RTL8366S_PHY_POWER_SAVING_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	testl	%r15d, %r15d
	je	LBB0_5
## %bb.4:
	orl	-36(%rbp), %r8d
	jmp	LBB0_6
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_7
LBB0_5:
	notl	%r8d
	andl	-36(%rbp), %r8d
LBB0_6:
	movl	%r8d, -36(%rbp)
	movl	(%r12), %ecx
	movq	%r14, %rdi
	movl	%ebx, %esi
	xorl	%edx, %edx
	callq	_rtl8366s_write_phy_reg
LBB0_7:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RTL8366S_NUM_PORTS,4,2         ## @RTL8366S_NUM_PORTS
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_RTL8366S_PHY_POWER_SAVING_CTRL_REG,4,2 ## @RTL8366S_PHY_POWER_SAVING_CTRL_REG
	.comm	_RTL8366S_PHY_POWER_SAVING_MASK,4,2 ## @RTL8366S_PHY_POWER_SAVING_MASK
	.no_dead_strip	_rtl8366s_set_green_port
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rtl8366s_set_green_port
_rtl8366s_set_green_port:               ; @rtl8366s_set_green_port
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
Lloh0:
	adrp	x8, _RTL8366S_NUM_PORTS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RTL8366S_NUM_PORTS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	b.le	LBB0_4
; %bb.1:
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
Lloh3:
	adrp	x22, _RTL8366S_PHY_POWER_SAVING_CTRL_REG@GOTPAGE
Lloh4:
	ldr	x22, [x22, _RTL8366S_PHY_POWER_SAVING_CTRL_REG@GOTPAGEOFF]
	ldr	w3, [x22]
	add	x4, sp, #12
	mov	w2, #0
	bl	_rtl8366s_read_phy_reg
	cbnz	w0, LBB0_7
; %bb.2:
Lloh5:
	adrp	x8, _RTL8366S_PHY_POWER_SAVING_MASK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _RTL8366S_PHY_POWER_SAVING_MASK@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cbz	w21, LBB0_5
; %bb.3:
	ldr	w9, [sp, #12]
	orr	w4, w9, w8
	b	LBB0_6
LBB0_4:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_7
LBB0_5:
	ldr	w9, [sp, #12]
	bic	w4, w9, w8
LBB0_6:
	str	w4, [sp, #12]
	ldr	w3, [x22]
	mov	x0, x20
	mov	x1, x19
	mov	w2, #0
	bl	_rtl8366s_write_phy_reg
LBB0_7:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_RTL8366S_NUM_PORTS,4,2         ; @RTL8366S_NUM_PORTS
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_RTL8366S_PHY_POWER_SAVING_CTRL_REG,4,2 ; @RTL8366S_PHY_POWER_SAVING_CTRL_REG
	.comm	_RTL8366S_PHY_POWER_SAVING_MASK,4,2 ; @RTL8366S_PHY_POWER_SAVING_MASK
	.no_dead_strip	_rtl8366s_set_green_port
.subsections_via_symbols
