	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rtl8366rb_detect
_rtl8366rb_detect:                      ## @rtl8366rb_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, %r15
	movq	24(%rdi), %r14
	movl	20(%rdi), %edi
	leaq	-28(%rbp), %rdx
	movl	$92, %esi
	callq	_regmap_read
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_8
LBB0_2:
	movl	-28(%rbp), %edx
	cmpl	$22839, %edx                    ## imm = 0x5937
	je	LBB0_5
## %bb.3:
	cmpl	$24615, %edx                    ## imm = 0x6027
	jne	LBB0_6
## %bb.4:
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_info
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_8
LBB0_5:
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_info
	movq	_RTL8366RB_PORT_NUM_CPU@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r15)
	movq	_RTL8366RB_NUM_PORTS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%r15)
	movq	_RTL8366RB_NUM_VLANS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r15)
	movq	_rtl8366rb_mib_counters@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%edi, 4(%r15)
	callq	_ARRAY_SIZE
	movl	%eax, (%r15)
	jmp	LBB0_7
LBB0_6:
	leaq	L_.str.4(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_info
LBB0_7:
	movq	%r15, %rdi
	callq	_rtl8366rb_reset_chip
	movl	%eax, %ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"can't get chip ID (%d)\n"

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

L_.str.2:                               ## @.str.2
	.asciz	"this switch is not yet supported, submit patches!\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.3:                               ## @.str.3
	.asciz	"found an RTL8366RB switch\n"

	.comm	_RTL8366RB_PORT_NUM_CPU,4,2     ## @RTL8366RB_PORT_NUM_CPU
	.comm	_RTL8366RB_NUM_PORTS,4,2        ## @RTL8366RB_NUM_PORTS
	.comm	_RTL8366RB_NUM_VLANS,4,2        ## @RTL8366RB_NUM_VLANS
	.comm	_rtl8366rb_mib_counters,4,2     ## @rtl8366rb_mib_counters
L_.str.4:                               ## @.str.4
	.asciz	"found an Unknown Realtek switch (id=0x%04x)\n"

	.no_dead_strip	_rtl8366rb_detect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rtl8366rb_detect
_rtl8366rb_detect:                      ; @rtl8366rb_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
	ldr	x20, [x0, #24]
	ldr	w0, [x0, #20]
	add	x2, sp, #12
	mov	w1, #92
	bl	_regmap_read
	cbz	w0, LBB0_2
; %bb.1:
	mov	x21, x0
	str	x21, [sp]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_err
	b	LBB0_8
LBB0_2:
	ldr	w8, [sp, #12]
	mov	w9, #22839
	cmp	w8, w9
	b.eq	LBB0_5
; %bb.3:
	mov	w9, #24615
	cmp	w8, w9
	b.ne	LBB0_6
; %bb.4:
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_dev_info
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	bl	_dev_err
Lloh6:
	adrp	x8, _ENODEV@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_8
LBB0_5:
Lloh9:
	adrp	x1, l_.str.3@PAGE
Lloh10:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	bl	_dev_info
Lloh11:
	adrp	x8, _RTL8366RB_PORT_NUM_CPU@GOTPAGE
Lloh12:
	ldr	x8, [x8, _RTL8366RB_PORT_NUM_CPU@GOTPAGEOFF]
Lloh13:
	adrp	x9, _RTL8366RB_NUM_PORTS@GOTPAGE
Lloh14:
	ldr	x9, [x9, _RTL8366RB_NUM_PORTS@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
Lloh16:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #12]
Lloh17:
	adrp	x8, _RTL8366RB_NUM_VLANS@GOTPAGE
Lloh18:
	ldr	x8, [x8, _RTL8366RB_NUM_VLANS@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
Lloh20:
	adrp	x9, _rtl8366rb_mib_counters@GOTPAGE
Lloh21:
	ldr	x9, [x9, _rtl8366rb_mib_counters@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x9]
	stp	w0, w8, [x19, #4]
	bl	_ARRAY_SIZE
	str	w0, [x19]
	b	LBB0_7
LBB0_6:
	str	x8, [sp]
Lloh23:
	adrp	x1, l_.str.4@PAGE
Lloh24:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x20
	bl	_dev_info
LBB0_7:
	mov	x0, x19
	bl	_rtl8366rb_reset_chip
	mov	x21, x0
LBB0_8:
	mov	x0, x21
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh15
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"can't get chip ID (%d)\n"

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

l_.str.2:                               ; @.str.2
	.asciz	"this switch is not yet supported, submit patches!\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.3:                               ; @.str.3
	.asciz	"found an RTL8366RB switch\n"

	.comm	_RTL8366RB_PORT_NUM_CPU,4,2     ; @RTL8366RB_PORT_NUM_CPU
	.comm	_RTL8366RB_NUM_PORTS,4,2        ; @RTL8366RB_NUM_PORTS
	.comm	_RTL8366RB_NUM_VLANS,4,2        ; @RTL8366RB_NUM_VLANS
	.comm	_rtl8366rb_mib_counters,4,2     ; @rtl8366rb_mib_counters
l_.str.4:                               ; @.str.4
	.asciz	"found an Unknown Realtek switch (id=0x%04x)\n"

	.no_dead_strip	_rtl8366rb_detect
.subsections_via_symbols
