	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rtl8366_smi_init               ## -- Begin function rtl8366_smi_init
	.p2align	4, 0x90
_rtl8366_smi_init:                      ## @rtl8366_smi_init
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	cmpq	$0, 8(%rdi)
	je	LBB0_1
## %bb.2:
	movq	%rdi, %r14
	movl	(%rdi), %edi
	callq	_dev_name
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	___rtl8366_smi_init
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_18
## %bb.3:
	movq	16(%r14), %rax
	movl	(%r14), %edi
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movl	(%rax), %edx
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_info
	jmp	LBB0_6
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_18
LBB0_4:
	movl	24(%r14), %ecx
	movl	28(%r14), %edx
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_info
LBB0_6:
	movq	8(%r14), %rax
	movq	%r14, %rdi
	callq	*(%rax)
	testl	%eax, %eax
	je	LBB0_10
## %bb.7:
	movl	%eax, %ebx
	movl	(%r14), %edi
	leaq	L_.str.2(%rip), %rsi
LBB0_8:
	movl	%ebx, %edx
	callq	_dev_err
	jmp	LBB0_9
LBB0_10:
	movq	%r14, %rdi
	callq	_rtl8366_reset
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_11
LBB0_9:
	movq	%r14, %rdi
	callq	___rtl8366_smi_cleanup
LBB0_18:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_11:
	movq	8(%r14), %rax
	movq	%r14, %rdi
	callq	*8(%rax)
	testl	%eax, %eax
	je	LBB0_13
## %bb.12:
	movl	%eax, %ebx
	movl	(%r14), %edi
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_8
LBB0_13:
	movq	%r14, %rdi
	callq	_rtl8366_init_vlan
	testl	%eax, %eax
	je	LBB0_15
## %bb.14:
	movl	%eax, %ebx
	movl	(%r14), %edi
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_8
LBB0_15:
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_rtl8366_enable_all_ports
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_9
## %bb.16:
	movq	%r14, %rdi
	callq	_rtl8366_smi_mii_init
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_9
## %bb.17:
	movq	%r14, %rdi
	callq	_rtl8366_debugfs_init
	xorl	%ebx, %ebx
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"using GPIO pins %u (SDA) and %u (SCK)\n"

L_.str.1:                               ## @.str.1
	.asciz	"using MDIO bus '%s'\n"

L_.str.2:                               ## @.str.2
	.asciz	"chip detection failed, err=%d\n"

L_.str.3:                               ## @.str.3
	.asciz	"chip setup failed, err=%d\n"

L_.str.4:                               ## @.str.4
	.asciz	"VLAN initialization failed, err=%d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rtl8366_smi_init               ; -- Begin function rtl8366_smi_init
	.p2align	2
_rtl8366_smi_init:                      ; @rtl8366_smi_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_4
; %bb.1:
	mov	x19, x0
	ldr	w0, [x0]
	bl	_dev_name
	mov	x1, x0
	mov	x0, x19
	bl	___rtl8366_smi_init
	mov	x20, x0
	cbnz	w0, LBB0_11
; %bb.2:
	ldr	x8, [x19, #16]
	ldr	w0, [x19]
	cbz	x8, LBB0_5
; %bb.3:
	ldr	w2, [x8]
Lloh0:
	adrp	x1, l_.str.1@PAGE
Lloh1:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_6
LBB0_4:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_11
LBB0_5:
	ldp	w8, w2, [x19, #24]
	str	x8, [sp]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
LBB0_6:
	bl	_dev_info
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	mov	x0, x19
	blr	x8
	cbz	w0, LBB0_9
; %bb.7:
	mov	x20, x0
	ldr	w0, [x19]
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_8:
	mov	x2, x20
	bl	_dev_err
	b	LBB0_10
LBB0_9:
	mov	x0, x19
	bl	_rtl8366_reset
	mov	x20, x0
	cbz	w0, LBB0_12
LBB0_10:
	mov	x0, x19
	bl	___rtl8366_smi_cleanup
LBB0_11:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_12:
	ldr	x8, [x19, #8]
	ldr	x8, [x8, #8]
	mov	x0, x19
	blr	x8
	cbz	w0, LBB0_14
; %bb.13:
	mov	x20, x0
	ldr	w0, [x19]
Lloh9:
	adrp	x1, l_.str.3@PAGE
Lloh10:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_8
LBB0_14:
	mov	x0, x19
	bl	_rtl8366_init_vlan
	cbz	w0, LBB0_16
; %bb.15:
	mov	x20, x0
	ldr	w0, [x19]
Lloh11:
	adrp	x1, l_.str.4@PAGE
Lloh12:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_8
LBB0_16:
	mov	x0, x19
	mov	w1, #1
	bl	_rtl8366_enable_all_ports
	mov	x20, x0
	cbnz	w0, LBB0_10
; %bb.17:
	mov	x0, x19
	bl	_rtl8366_smi_mii_init
	mov	x20, x0
	cbnz	w0, LBB0_10
; %bb.18:
	mov	x0, x19
	bl	_rtl8366_debugfs_init
	b	LBB0_11
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"using GPIO pins %u (SDA) and %u (SCK)\n"

l_.str.1:                               ; @.str.1
	.asciz	"using MDIO bus '%s'\n"

l_.str.2:                               ; @.str.2
	.asciz	"chip detection failed, err=%d\n"

l_.str.3:                               ; @.str.3
	.asciz	"chip setup failed, err=%d\n"

l_.str.4:                               ; @.str.4
	.asciz	"VLAN initialization failed, err=%d\n"

.subsections_via_symbols
