	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rtl8367_detect
_rtl8367_detect:                        ## @rtl8367_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, %r14
	movl	$0, -32(%rbp)
	movl	$0, -28(%rbp)
	movq	_RTL8367_RTL_NO_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-32(%rbp), %rdx
	callq	_rtl8366_smi_read_reg
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_8
LBB0_2:
	movl	-32(%rbp), %edx
	cmpl	$128, %edx
	je	LBB0_3
## %bb.4:
	cmpl	$129, %edx
	jne	LBB0_11
## %bb.5:
	leaq	L_.str.2(%rip), %r15
	jmp	LBB0_6
LBB0_3:
	leaq	L_.str.1(%rip), %r15
LBB0_6:
	movq	_RTL8367_RTL_VER_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-28(%rbp), %rdx
	movq	%r14, %rdi
	callq	_rtl8366_smi_read_reg
	movl	(%r14), %edi
	testl	%eax, %eax
	je	LBB0_9
## %bb.7:
	movl	%eax, %ebx
	leaq	L_.str.4(%rip), %rsi
LBB0_8:
	xorl	%eax, %eax
	callq	_dev_err
LBB0_10:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movl	(%r14), %edi
	leaq	L_.str.3(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_9:
	movq	_RTL8367_RTL_VER_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	andl	-28(%rbp), %ecx
	leaq	L_.str.5(%rip), %rsi
	movq	%r15, %rdx
	callq	_dev_info
	xorl	%ebx, %ebx
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_RTL8367_RTL_NO_REG,4,2         ## @RTL8367_RTL_NO_REG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unable to read chip number\n"

L_.str.1:                               ## @.str.1
	.asciz	"8367R"

L_.str.2:                               ## @.str.2
	.asciz	"8367M"

L_.str.3:                               ## @.str.3
	.asciz	"unknown chip number (%04x)\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_RTL8367_RTL_VER_REG,4,2        ## @RTL8367_RTL_VER_REG
L_.str.4:                               ## @.str.4
	.asciz	"unable to read chip version\n"

L_.str.5:                               ## @.str.5
	.asciz	"RTL%s ver. %u chip found\n"

	.comm	_RTL8367_RTL_VER_MASK,4,2       ## @RTL8367_RTL_VER_MASK
	.no_dead_strip	_rtl8367_detect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rtl8367_detect
_rtl8367_detect:                        ; @rtl8367_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	x19, x0
	str	xzr, [sp, #8]
Lloh0:
	adrp	x8, _RTL8367_RTL_NO_REG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RTL8367_RTL_NO_REG@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_rtl8366_smi_read_reg
	cbz	w0, LBB0_2
; %bb.1:
	mov	x20, x0
	ldr	w0, [x19]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_10
LBB0_2:
	ldr	w8, [sp, #12]
	cmp	w8, #128
	b.eq	LBB0_5
; %bb.3:
	cmp	w8, #129
	b.ne	LBB0_8
; %bb.4:
Lloh5:
	adrp	x21, l_.str.2@PAGE
Lloh6:
	add	x21, x21, l_.str.2@PAGEOFF
	b	LBB0_6
LBB0_5:
Lloh7:
	adrp	x21, l_.str.1@PAGE
Lloh8:
	add	x21, x21, l_.str.1@PAGEOFF
LBB0_6:
Lloh9:
	adrp	x8, _RTL8367_RTL_VER_REG@GOTPAGE
Lloh10:
	ldr	x8, [x8, _RTL8367_RTL_VER_REG@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x19
	bl	_rtl8366_smi_read_reg
	mov	x20, x0
	ldr	w0, [x19]
	cbz	w20, LBB0_9
; %bb.7:
Lloh12:
	adrp	x1, l_.str.4@PAGE
Lloh13:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_err
	b	LBB0_10
LBB0_8:
	ldr	w0, [x19]
	str	x8, [sp]
Lloh14:
	adrp	x1, l_.str.3@PAGE
Lloh15:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_err
Lloh16:
	adrp	x8, _ENODEV@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_10
LBB0_9:
	ldr	w8, [sp, #8]
Lloh19:
	adrp	x9, _RTL8367_RTL_VER_MASK@GOTPAGE
Lloh20:
	ldr	x9, [x9, _RTL8367_RTL_VER_MASK@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	and	w3, w9, w8
Lloh22:
	adrp	x1, l_.str.5@PAGE
Lloh23:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x2, x21
	bl	_dev_info
LBB0_10:
	mov	x0, x20
	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 AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_RTL8367_RTL_NO_REG,4,2         ; @RTL8367_RTL_NO_REG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unable to read chip number\n"

l_.str.1:                               ; @.str.1
	.asciz	"8367R"

l_.str.2:                               ; @.str.2
	.asciz	"8367M"

l_.str.3:                               ; @.str.3
	.asciz	"unknown chip number (%04x)\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_RTL8367_RTL_VER_REG,4,2        ; @RTL8367_RTL_VER_REG
l_.str.4:                               ; @.str.4
	.asciz	"unable to read chip version\n"

l_.str.5:                               ; @.str.5
	.asciz	"RTL%s ver. %u chip found\n"

	.comm	_RTL8367_RTL_VER_MASK,4,2       ; @RTL8367_RTL_VER_MASK
	.no_dead_strip	_rtl8367_detect
.subsections_via_symbols
