	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rtl8366s_setGreenEthernet      ## -- Begin function rtl8366s_setGreenEthernet
	.p2align	4, 0x90
_rtl8366s_setGreenEthernet:             ## @rtl8366s_setGreenEthernet
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movl	%edi, %r15d
	movq	_RTL8366S_MODEL_ID_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-44(%rbp), %rsi
	callq	_rtl8366_readRegister
	movl	$-1, %r12d
	testq	%rax, %rax
	je	LBB0_1
LBB0_24:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movl	-44(%rbp), %eax
	cmpl	$128, %eax
	je	LBB0_15
## %bb.2:
	testl	%eax, %eax
	jne	LBB0_25
## %bb.3:
	movq	_RTL8366S_PHY_ACCESS_CTRL_REG@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	movq	_RTL8366S_PHY_CTRL_WRITE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	callq	_rtl8366_writeRegister
	testl	%eax, %eax
	jne	LBB0_24
## %bb.4:
	movl	$48731, %edi                    ## imm = 0xBE5B
	movl	$13568, %esi                    ## imm = 0x3500
	callq	_rtl8366_writeRegister
	testl	%eax, %eax
	jne	LBB0_24
## %bb.5:
	movl	(%r13), %edi
	movl	(%rbx), %esi
	callq	_rtl8366_writeRegister
	testl	%eax, %eax
	jne	LBB0_24
## %bb.6:
	movl	$48732, %edi                    ## imm = 0xBE5C
	movl	$47477, %esi                    ## imm = 0xB975
	callq	_rtl8366_writeRegister
	testl	%eax, %eax
	jne	LBB0_24
## %bb.7:
	movl	(%r13), %edi
	movl	(%rbx), %esi
	callq	_rtl8366_writeRegister
	testl	%eax, %eax
	jne	LBB0_24
## %bb.8:
	movl	$48733, %edi                    ## imm = 0xBE5D
	movl	$47545, %esi                    ## imm = 0xB9B9
	callq	_rtl8366_writeRegister
	testl	%eax, %eax
	jne	LBB0_24
## %bb.9:
	movl	(%r13), %edi
	movl	(%rbx), %esi
	callq	_rtl8366_writeRegister
	testl	%eax, %eax
	jne	LBB0_24
## %bb.10:
	movl	$48759, %edi                    ## imm = 0xBE77
	movl	$42240, %esi                    ## imm = 0xA500
	callq	_rtl8366_writeRegister
	testl	%eax, %eax
	jne	LBB0_24
## %bb.11:
	movl	(%r13), %edi
	movl	(%rbx), %esi
	callq	_rtl8366_writeRegister
	testl	%eax, %eax
	jne	LBB0_24
## %bb.12:
	movl	$48760, %edi                    ## imm = 0xBE78
	movl	$23160, %esi                    ## imm = 0x5A78
	callq	_rtl8366_writeRegister
	testl	%eax, %eax
	jne	LBB0_24
## %bb.13:
	movl	(%r13), %edi
	movl	(%rbx), %esi
	callq	_rtl8366_writeRegister
	testl	%eax, %eax
	jne	LBB0_24
## %bb.14:
	movl	$48761, %edi                    ## imm = 0xBE79
	movl	$25720, %esi                    ## imm = 0x6478
	jmp	LBB0_17
LBB0_15:
	movq	_RTL8366S_PHY_ACCESS_CTRL_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_RTL8366S_PHY_CTRL_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_rtl8366_writeRegister
	testl	%eax, %eax
	jne	LBB0_24
## %bb.16:
	movl	$48731, %edi                    ## imm = 0xBE5B
	movl	$13568, %esi                    ## imm = 0x3500
LBB0_17:
	callq	_rtl8366_writeRegister
	testl	%eax, %eax
	jne	LBB0_24
## %bb.18:
	movl	%r15d, %edi
	movl	%r14d, %esi
	callq	_rtl8366s_setGreenFeature
	testq	%rax, %rax
	jne	LBB0_24
## %bb.19:
	movq	_RTL8366S_PHY_NO_MAX@GOTPCREL(%rip), %r15
	xorl	%r12d, %r12d
	cmpl	$0, (%r15)
	js	LBB0_24
## %bb.20:
	movl	$-1, %ebx
LBB0_22:                                ## =>This Inner Loop Header: Depth=1
	incl	%ebx
	movl	%ebx, %edi
	movl	%r14d, %esi
	callq	_rtl8366s_setPowerSaving
	testq	%rax, %rax
	jne	LBB0_23
## %bb.21:                              ##   in Loop: Header=BB0_22 Depth=1
	cmpl	(%r15), %ebx
	jl	LBB0_22
	jmp	LBB0_24
LBB0_25:
	leaq	L_str(%rip), %rdi
	callq	_puts
	jmp	LBB0_24
LBB0_23:
	movl	$-1, %r12d
	jmp	LBB0_24
	.cfi_endproc
                                        ## -- End function
	.comm	_RTL8366S_MODEL_ID_REG,4,2      ## @RTL8366S_MODEL_ID_REG
	.comm	_RTL8366S_PHY_ACCESS_CTRL_REG,4,2 ## @RTL8366S_PHY_ACCESS_CTRL_REG
	.comm	_RTL8366S_PHY_CTRL_WRITE,4,2    ## @RTL8366S_PHY_CTRL_WRITE
	.comm	_RTL8366S_PHY_NO_MAX,4,2        ## @RTL8366S_PHY_NO_MAX
	.section	__TEXT,__cstring,cstring_literals
L_str:                                  ## @str
	.asciz	"rtl8366s_initChip: unsupported chip found!"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rtl8366s_setGreenEthernet      ; -- Begin function rtl8366s_setGreenEthernet
	.p2align	2
_rtl8366s_setGreenEthernet:             ; @rtl8366s_setGreenEthernet
	.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
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _RTL8366S_MODEL_ID_REG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RTL8366S_MODEL_ID_REG@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	add	x1, sp, #12
	bl	_rtl8366_readRegister
	cbz	x0, LBB0_3
LBB0_1:
	mov	w0, #-1
LBB0_2:
	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
LBB0_3:
	ldr	w8, [sp, #12]
	cmp	w8, #128
	b.eq	LBB0_17
; %bb.4:
	cbnz	w8, LBB0_25
; %bb.5:
Lloh3:
	adrp	x21, _RTL8366S_PHY_ACCESS_CTRL_REG@GOTPAGE
Lloh4:
	ldr	x21, [x21, _RTL8366S_PHY_ACCESS_CTRL_REG@GOTPAGEOFF]
	ldr	w0, [x21]
Lloh5:
	adrp	x22, _RTL8366S_PHY_CTRL_WRITE@GOTPAGE
Lloh6:
	ldr	x22, [x22, _RTL8366S_PHY_CTRL_WRITE@GOTPAGEOFF]
	ldr	w1, [x22]
	bl	_rtl8366_writeRegister
	cbnz	w0, LBB0_1
; %bb.6:
	mov	w0, #48731
	mov	w1, #13568
	bl	_rtl8366_writeRegister
	cbnz	w0, LBB0_1
; %bb.7:
	ldr	w0, [x21]
	ldr	w1, [x22]
	bl	_rtl8366_writeRegister
	cbnz	w0, LBB0_1
; %bb.8:
	mov	w0, #48732
	mov	w1, #47477
	bl	_rtl8366_writeRegister
	cbnz	w0, LBB0_1
; %bb.9:
	ldr	w0, [x21]
	ldr	w1, [x22]
	bl	_rtl8366_writeRegister
	cbnz	w0, LBB0_1
; %bb.10:
	mov	w0, #48733
	mov	w1, #47545
	bl	_rtl8366_writeRegister
	cbnz	w0, LBB0_1
; %bb.11:
	ldr	w0, [x21]
	ldr	w1, [x22]
	bl	_rtl8366_writeRegister
	cbnz	w0, LBB0_1
; %bb.12:
	mov	w0, #48759
	mov	w1, #42240
	bl	_rtl8366_writeRegister
	cbnz	w0, LBB0_1
; %bb.13:
	ldr	w0, [x21]
	ldr	w1, [x22]
	bl	_rtl8366_writeRegister
	cbnz	w0, LBB0_1
; %bb.14:
	mov	w0, #48760
	mov	w1, #23160
	bl	_rtl8366_writeRegister
	cbnz	w0, LBB0_1
; %bb.15:
	ldr	w0, [x21]
	ldr	w1, [x22]
	bl	_rtl8366_writeRegister
	cbnz	w0, LBB0_1
; %bb.16:
	mov	w0, #48761
	mov	w1, #25720
	b	LBB0_19
LBB0_17:
Lloh7:
	adrp	x8, _RTL8366S_PHY_ACCESS_CTRL_REG@GOTPAGE
Lloh8:
	ldr	x8, [x8, _RTL8366S_PHY_ACCESS_CTRL_REG@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
Lloh10:
	adrp	x8, _RTL8366S_PHY_CTRL_WRITE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _RTL8366S_PHY_CTRL_WRITE@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	bl	_rtl8366_writeRegister
	cbnz	w0, LBB0_1
; %bb.18:
	mov	w0, #48731
	mov	w1, #13568
LBB0_19:
	bl	_rtl8366_writeRegister
	cbnz	w0, LBB0_1
; %bb.20:
	mov	x0, x20
	mov	x1, x19
	bl	_rtl8366s_setGreenFeature
	cbnz	x0, LBB0_1
; %bb.21:
Lloh13:
	adrp	x21, _RTL8366S_PHY_NO_MAX@GOTPAGE
Lloh14:
	ldr	x21, [x21, _RTL8366S_PHY_NO_MAX@GOTPAGEOFF]
	ldr	w8, [x21]
	tbnz	w8, #31, LBB0_26
; %bb.22:
	mov	w20, #-1
LBB0_23:                                ; =>This Inner Loop Header: Depth=1
	add	w20, w20, #1
	mov	x0, x20
	mov	x1, x19
	bl	_rtl8366s_setPowerSaving
	cbnz	x0, LBB0_1
; %bb.24:                               ;   in Loop: Header=BB0_23 Depth=1
	ldr	w8, [x21]
	cmp	w20, w8
	b.lt	LBB0_23
	b	LBB0_2
LBB0_25:
Lloh15:
	adrp	x0, l_str@PAGE
Lloh16:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
	b	LBB0_1
LBB0_26:
	mov	w0, #0
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_RTL8366S_MODEL_ID_REG,4,2      ; @RTL8366S_MODEL_ID_REG
	.comm	_RTL8366S_PHY_ACCESS_CTRL_REG,4,2 ; @RTL8366S_PHY_ACCESS_CTRL_REG
	.comm	_RTL8366S_PHY_CTRL_WRITE,4,2    ; @RTL8366S_PHY_CTRL_WRITE
	.comm	_RTL8366S_PHY_NO_MAX,4,2        ; @RTL8366S_PHY_NO_MAX
	.section	__TEXT,__cstring,cstring_literals
l_str:                                  ; @str
	.asciz	"rtl8366s_initChip: unsupported chip found!"

.subsections_via_symbols
