	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rtl8366s_initialize            ## -- Begin function rtl8366s_initialize
	.p2align	4, 0x90
_rtl8366s_initialize:                   ## @rtl8366s_initialize
	.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
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_DBG
	xorl	%eax, %eax
	callq	_smi_init
	movq	_RTL8366S_CHIP_ID_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-12(%rbp), %rsi
	callq	_rtl8366_readRegister
	movl	-12(%rbp), %esi
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_DBG
	cmpl	$33638, -12(%rbp)               ## imm = 0x8366
	jne	LBB0_1
## %bb.2:
	xorl	%eax, %eax
	callq	_rtl8366s_initChip
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	leaq	L_str.7(%rip), %rdi
	jmp	LBB0_8
LBB0_1:
	leaq	L_str.8(%rip), %rdi
LBB0_8:
	callq	_puts
	movl	$-1, %ebx
LBB0_9:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_4:
	movl	$1, %edi
	movl	$1, %esi
	callq	_rtl8366s_setGreenEthernet
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	leaq	L_str.6(%rip), %rdi
	jmp	LBB0_8
LBB0_6:
	xorl	%ebx, %ebx
	movl	$5, %edi
	movl	$1, %esi
	xorl	%edx, %edx
	callq	_rtl8366s_setCPUPort
	testq	%rax, %rax
	je	LBB0_9
## %bb.7:
	leaq	L_str(%rip), %rdi
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"rtl8366s_initialize: start setup\n"

	.comm	_RTL8366S_CHIP_ID_REG,4,2       ## @RTL8366S_CHIP_ID_REG
L_.str.1:                               ## @.str.1
	.asciz	"Realtek 8366SR switch ID %#04x\n"

L_str:                                  ## @str
	.asciz	"rtl8366s_initialize: set CPU port failed"

L_str.6:                                ## @str.6
	.asciz	"rtl8366s_initialize: set green ethernet failed"

L_str.7:                                ## @str.7
	.asciz	"rtl8366s_initialize: init chip failed"

L_str.8:                                ## @str.8
	.asciz	"rtl8366s_initialize: found unsupported switch"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rtl8366s_initialize            ; -- Begin function rtl8366s_initialize
	.p2align	2
_rtl8366s_initialize:                   ; @rtl8366s_initialize
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #32
	.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
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DBG
	bl	_smi_init
Lloh2:
	adrp	x8, _RTL8366S_CHIP_ID_REG@GOTPAGE
Lloh3:
	ldr	x8, [x8, _RTL8366S_CHIP_ID_REG@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	sub	x1, x29, #4
	bl	_rtl8366_readRegister
	ldur	w8, [x29, #-4]
	str	x8, [sp]
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DBG
	ldur	w8, [x29, #-4]
	mov	w9, #33638
	cmp	w8, w9
	b.ne	LBB0_3
; %bb.1:
	bl	_rtl8366s_initChip
	cbz	x0, LBB0_6
; %bb.2:
Lloh7:
	adrp	x0, l_str.7@PAGE
Lloh8:
	add	x0, x0, l_str.7@PAGEOFF
	b	LBB0_4
LBB0_3:
Lloh9:
	adrp	x0, l_str.8@PAGE
Lloh10:
	add	x0, x0, l_str.8@PAGEOFF
LBB0_4:
	bl	_puts
	mov	w0, #-1
LBB0_5:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #32
	ret
LBB0_6:
	mov	w0, #1
	mov	w1, #1
	bl	_rtl8366s_setGreenEthernet
	cbz	x0, LBB0_8
; %bb.7:
Lloh11:
	adrp	x0, l_str.6@PAGE
Lloh12:
	add	x0, x0, l_str.6@PAGEOFF
	b	LBB0_4
LBB0_8:
	mov	w0, #5
	mov	w1, #1
	mov	w2, #0
	bl	_rtl8366s_setCPUPort
	cbz	x0, LBB0_5
; %bb.9:
Lloh13:
	adrp	x0, l_str@PAGE
Lloh14:
	add	x0, x0, l_str@PAGEOFF
	b	LBB0_4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"rtl8366s_initialize: start setup\n"

	.comm	_RTL8366S_CHIP_ID_REG,4,2       ; @RTL8366S_CHIP_ID_REG
l_.str.1:                               ; @.str.1
	.asciz	"Realtek 8366SR switch ID %#04x\n"

l_str:                                  ; @str
	.asciz	"rtl8366s_initialize: set CPU port failed"

l_str.6:                                ; @str.6
	.asciz	"rtl8366s_initialize: set green ethernet failed"

l_str.7:                                ; @str.7
	.asciz	"rtl8366s_initialize: init chip failed"

l_str.8:                                ; @str.8
	.asciz	"rtl8366s_initialize: found unsupported switch"

.subsections_via_symbols
