	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rtl8366_smi_detect             ## -- Begin function rtl8366_smi_detect
	.p2align	4, 0x90
_rtl8366_smi_detect:                    ## @rtl8366_smi_detect
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	_RTL8366_TYPE_UNKNOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	$0, -28(%rbp)
	leaq	_rtl8366_smi_detect.smi(%rip), %r15
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$20, %edx
	callq	_memset
	movl	4(%rbx), %eax
	movl	%eax, _rtl8366_smi_detect.smi+16(%rip)
	movl	(%rbx), %eax
	movl	%eax, _rtl8366_smi_detect.smi+12(%rip)
	movabsq	$725849473034, %rax             ## imm = 0xA90000000A
	movq	%rax, _rtl8366_smi_detect.smi(%rip)
	movl	$168, _rtl8366_smi_detect.smi+8(%rip)
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	___rtl8366_smi_init
	testq	%rax, %rax
	jne	LBB0_8
## %bb.1:
	leaq	_rtl8366_smi_detect.smi(%rip), %rdi
	leaq	-28(%rbp), %rdx
	movl	$92, %esi
	callq	_rtl8366_smi_read_reg
	testq	%rax, %rax
	je	LBB0_2
LBB0_7:
	leaq	_rtl8366_smi_detect.smi(%rip), %rdi
	callq	___rtl8366_smi_cleanup
LBB0_8:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movl	-28(%rbp), %esi
	cmpl	$22839, %esi                    ## imm = 0x5937
	je	LBB0_5
## %bb.3:
	cmpl	$24615, %esi                    ## imm = 0x6027
	jne	LBB0_6
## %bb.4:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_printk
	movq	_RTL8366_TYPE_S@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	jmp	LBB0_7
LBB0_5:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_printk
	movq	_RTL8366_TYPE_RB@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	jmp	LBB0_7
LBB0_6:
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_printk
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_rtl8366_smi_detect.smi,20,2 ## @rtl8366_smi_detect.smi
	.comm	_RTL8366_TYPE_UNKNOWN,4,2       ## @RTL8366_TYPE_UNKNOWN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"rtl8366"

L_.str.1:                               ## @.str.1
	.asciz	"Found an RTL8366S switch\n"

	.comm	_RTL8366_TYPE_S,4,2             ## @RTL8366_TYPE_S
L_.str.2:                               ## @.str.2
	.asciz	"Found an RTL8366RB switch\n"

	.comm	_RTL8366_TYPE_RB,4,2            ## @RTL8366_TYPE_RB
L_.str.3:                               ## @.str.3
	.asciz	"Found an Unknown RTL8366 switch (id=0x%04x)\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function rtl8366_smi_detect
lCPI0_0:
	.long	10                              ; 0xa
	.long	169                             ; 0xa9
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_rtl8366_smi_detect
	.p2align	2
_rtl8366_smi_detect:                    ; @rtl8366_smi_detect
	.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	x20, x0
Lloh0:
	adrp	x8, _RTL8366_TYPE_UNKNOWN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RTL8366_TYPE_UNKNOWN@GOTPAGEOFF]
Lloh2:
	ldr	w19, [x8]
	str	wzr, [sp, #12]
Lloh3:
	adrp	x21, _rtl8366_smi_detect.smi@PAGE
Lloh4:
	add	x21, x21, _rtl8366_smi_detect.smi@PAGEOFF
	mov	x0, x21
	mov	w1, #0
	mov	w2, #20
	bl	_memset
	ldr	d0, [x20]
	stur	d0, [x21, #12]
Lloh5:
	adrp	x8, lCPI0_0@PAGE
Lloh6:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [x21]
	mov	w8, #168
	str	w8, [x21, #8]
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	___rtl8366_smi_init
	cbnz	x0, LBB0_3
; %bb.1:
Lloh9:
	adrp	x0, _rtl8366_smi_detect.smi@PAGE
Lloh10:
	add	x0, x0, _rtl8366_smi_detect.smi@PAGEOFF
	add	x2, sp, #12
	mov	w1, #92
	bl	_rtl8366_smi_read_reg
	cbz	x0, LBB0_4
LBB0_2:
Lloh11:
	adrp	x0, _rtl8366_smi_detect.smi@PAGE
Lloh12:
	add	x0, x0, _rtl8366_smi_detect.smi@PAGEOFF
	bl	___rtl8366_smi_cleanup
LBB0_3:
	mov	x0, x19
	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_4:
	ldr	w8, [sp, #12]
	mov	w9, #22839
	cmp	w8, w9
	b.eq	LBB0_7
; %bb.5:
	mov	w9, #24615
	cmp	w8, w9
	b.ne	LBB0_8
; %bb.6:
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_printk
Lloh15:
	adrp	x8, _RTL8366_TYPE_S@GOTPAGE
Lloh16:
	ldr	x8, [x8, _RTL8366_TYPE_S@GOTPAGEOFF]
Lloh17:
	ldr	w19, [x8]
	b	LBB0_2
LBB0_7:
Lloh18:
	adrp	x0, l_.str.2@PAGE
Lloh19:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_printk
Lloh20:
	adrp	x8, _RTL8366_TYPE_RB@GOTPAGE
Lloh21:
	ldr	x8, [x8, _RTL8366_TYPE_RB@GOTPAGEOFF]
Lloh22:
	ldr	w19, [x8]
	b	LBB0_2
LBB0_8:
	str	x8, [sp]
Lloh23:
	adrp	x0, l_.str.3@PAGE
Lloh24:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_printk
	b	LBB0_2
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdr	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_rtl8366_smi_detect.smi,20,3 ; @rtl8366_smi_detect.smi
	.comm	_RTL8366_TYPE_UNKNOWN,4,2       ; @RTL8366_TYPE_UNKNOWN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"rtl8366"

l_.str.1:                               ; @.str.1
	.asciz	"Found an RTL8366S switch\n"

	.comm	_RTL8366_TYPE_S,4,2             ; @RTL8366_TYPE_S
l_.str.2:                               ; @.str.2
	.asciz	"Found an RTL8366RB switch\n"

	.comm	_RTL8366_TYPE_RB,4,2            ; @RTL8366_TYPE_RB
l_.str.3:                               ; @.str.3
	.asciz	"Found an Unknown RTL8366 switch (id=0x%04x)\n"

.subsections_via_symbols
