	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rtl8367_init_regs
_rtl8367_init_regs:                     ## @rtl8367_init_regs
	.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	_RTL8367_RTL_MAGIC_ID_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_RTL8367_RTL_MAGIC_ID_VAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_REG_WR
	movq	_RTL8367_CHIP_VER_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-28(%rbp), %r14
	movq	%r15, %rdi
	movq	%r14, %rdx
	callq	_REG_RD
	movl	-28(%rbp), %ebx
	movq	_RTL8367_CHIP_VER_RLVID_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	sarl	%cl, %ebx
	movq	_RTL8367_CHIP_VER_RLVID_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	movq	_RTL8367_CHIP_MODE_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movq	%r14, %rdx
	callq	_REG_RD
	movq	_RTL8367_CHIP_MODE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	andl	-28(%rbp), %r14d
	cmpl	$1, %ebx
	je	LBB0_3
## %bb.1:
	testl	%ebx, %ebx
	jne	LBB0_11
## %bb.2:
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_rtl8367_init_regs0
	jmp	LBB0_13
LBB0_3:
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$31, %edx
	movl	$5, %ecx
	callq	_rtl8367_write_phy_reg
	testl	%eax, %eax
	jne	LBB0_13
## %bb.4:
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$5, %edx
	movl	$16382, %ecx                    ## imm = 0x3FFE
	callq	_rtl8367_write_phy_reg
	testl	%eax, %eax
	jne	LBB0_13
## %bb.5:
	leaq	-28(%rbp), %rcx
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$6, %edx
	callq	_rtl8367_read_phy_reg
	testl	%eax, %eax
	jne	LBB0_13
## %bb.6:
	movl	-28(%rbp), %edx
	cmpl	$8452, %edx                     ## imm = 0x2104
	je	LBB0_9
## %bb.7:
	cmpl	$38123, %edx                    ## imm = 0x94EB
	jne	LBB0_10
## %bb.8:
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_rtl8367_init_regs1
	jmp	LBB0_13
LBB0_11:
	movl	(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edx
LBB0_12:
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_rtl8367_init_regs2
	jmp	LBB0_13
LBB0_10:
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_RTL8367_RTL_MAGIC_ID_REG,4,2   ## @RTL8367_RTL_MAGIC_ID_REG
	.comm	_RTL8367_RTL_MAGIC_ID_VAL,4,2   ## @RTL8367_RTL_MAGIC_ID_VAL
	.comm	_RTL8367_CHIP_VER_REG,4,2       ## @RTL8367_CHIP_VER_REG
	.comm	_RTL8367_CHIP_VER_RLVID_SHIFT,4,2 ## @RTL8367_CHIP_VER_RLVID_SHIFT
	.comm	_RTL8367_CHIP_VER_RLVID_MASK,4,2 ## @RTL8367_CHIP_VER_RLVID_MASK
	.comm	_RTL8367_CHIP_MODE_REG,4,2      ## @RTL8367_CHIP_MODE_REG
	.comm	_RTL8367_CHIP_MODE_MASK,4,2     ## @RTL8367_CHIP_MODE_MASK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unknow phy data %04x\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.1:                               ## @.str.1
	.asciz	"unknow rlvid %u\n"

	.no_dead_strip	_rtl8367_init_regs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rtl8367_init_regs
_rtl8367_init_regs:                     ; @rtl8367_init_regs
	.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
Lloh0:
	adrp	x8, _RTL8367_RTL_MAGIC_ID_REG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RTL8367_RTL_MAGIC_ID_REG@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _RTL8367_RTL_MAGIC_ID_VAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RTL8367_RTL_MAGIC_ID_VAL@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	bl	_REG_WR
Lloh6:
	adrp	x8, _RTL8367_CHIP_VER_REG@GOTPAGE
Lloh7:
	ldr	x8, [x8, _RTL8367_CHIP_VER_REG@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x19
	bl	_REG_RD
	ldr	w8, [sp, #12]
Lloh9:
	adrp	x9, _RTL8367_CHIP_VER_RLVID_SHIFT@GOTPAGE
Lloh10:
	ldr	x9, [x9, _RTL8367_CHIP_VER_RLVID_SHIFT@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
Lloh12:
	adrp	x10, _RTL8367_CHIP_VER_RLVID_MASK@GOTPAGE
Lloh13:
	ldr	x10, [x10, _RTL8367_CHIP_VER_RLVID_MASK@GOTPAGEOFF]
	asr	w8, w8, w9
Lloh14:
	ldr	w9, [x10]
	and	w21, w8, w9
Lloh15:
	adrp	x8, _RTL8367_CHIP_MODE_REG@GOTPAGE
Lloh16:
	ldr	x8, [x8, _RTL8367_CHIP_MODE_REG@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x19
	bl	_REG_RD
	ldr	w8, [sp, #12]
Lloh18:
	adrp	x9, _RTL8367_CHIP_MODE_MASK@GOTPAGE
Lloh19:
	ldr	x9, [x9, _RTL8367_CHIP_MODE_MASK@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	and	w20, w9, w8
	cmp	w21, #1
	b.eq	LBB0_3
; %bb.1:
	cbnz	w21, LBB0_9
; %bb.2:
	mov	x0, x19
	mov	x1, x20
	bl	_rtl8367_init_regs0
	b	LBB0_11
LBB0_3:
	mov	x0, x19
	mov	w1, #0
	mov	w2, #31
	mov	w3, #5
	bl	_rtl8367_write_phy_reg
	cbnz	w0, LBB0_11
; %bb.4:
	mov	x0, x19
	mov	w1, #0
	mov	w2, #5
	mov	w3, #16382
	bl	_rtl8367_write_phy_reg
	cbnz	w0, LBB0_11
; %bb.5:
	add	x3, sp, #12
	mov	x0, x19
	mov	w1, #0
	mov	w2, #6
	bl	_rtl8367_read_phy_reg
	cbnz	w0, LBB0_11
; %bb.6:
	ldr	w2, [sp, #12]
	mov	w8, #8452
	cmp	w2, w8
	b.eq	LBB0_12
; %bb.7:
	mov	w8, #38123
	cmp	w2, w8
	b.ne	LBB0_13
; %bb.8:
	mov	x0, x19
	mov	x1, x20
	bl	_rtl8367_init_regs1
	b	LBB0_11
LBB0_9:
	ldr	w0, [x19]
Lloh21:
	adrp	x1, l_.str.1@PAGE
Lloh22:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x21
LBB0_10:
	bl	_dev_err
Lloh23:
	adrp	x8, _ENODEV@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
	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_12:
	mov	x0, x19
	mov	x1, x20
	bl	_rtl8367_init_regs2
	b	LBB0_11
LBB0_13:
	ldr	w0, [x19]
Lloh26:
	adrp	x1, l_.str@PAGE
Lloh27:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_RTL8367_RTL_MAGIC_ID_REG,4,2   ; @RTL8367_RTL_MAGIC_ID_REG
	.comm	_RTL8367_RTL_MAGIC_ID_VAL,4,2   ; @RTL8367_RTL_MAGIC_ID_VAL
	.comm	_RTL8367_CHIP_VER_REG,4,2       ; @RTL8367_CHIP_VER_REG
	.comm	_RTL8367_CHIP_VER_RLVID_SHIFT,4,2 ; @RTL8367_CHIP_VER_RLVID_SHIFT
	.comm	_RTL8367_CHIP_VER_RLVID_MASK,4,2 ; @RTL8367_CHIP_VER_RLVID_MASK
	.comm	_RTL8367_CHIP_MODE_REG,4,2      ; @RTL8367_CHIP_MODE_REG
	.comm	_RTL8367_CHIP_MODE_MASK,4,2     ; @RTL8367_CHIP_MODE_MASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unknow phy data %04x\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.1:                               ; @.str.1
	.asciz	"unknow rlvid %u\n"

	.no_dead_strip	_rtl8367_init_regs
.subsections_via_symbols
