	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rtl8367b_setup
_rtl8367b_setup:                        ## @rtl8367b_setup
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	(%rdi), %rax
	movq	8(%rax), %rbx
	callq	_rtl8367b_init_regs
	movl	%eax, %r15d
	testl	%eax, %eax
	je	LBB0_1
LBB0_11:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	(%r14), %rax
	cmpq	$0, (%rax)
	je	LBB0_4
## %bb.2:
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_rtl8367b_extif_init_of
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_11
## %bb.3:
	leaq	L_.str.1(%rip), %rdx
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_rtl8367b_extif_init_of
	jmp	LBB0_6
LBB0_4:
	movl	4(%rbx), %edx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_rtl8367b_extif_init
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_11
## %bb.5:
	movl	(%rbx), %edx
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_rtl8367b_extif_init
LBB0_6:
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_11
## %bb.7:
	movq	_RTL8367B_SWC0_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_RTL8367B_SWC0_MAX_LENGTH_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_RTL8367B_SWC0_MAX_LENGTH_1536@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	callq	_REG_RMW
	movq	_RTL8367B_VLAN_INGRESS_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_RTL8367B_PORTS_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_REG_WR
	movq	_RTL8367B_NUM_PORTS@GOTPCREL(%rip), %r12
	cmpl	$0, (%r12)
	jle	LBB0_8
## %bb.9:
	xorl	%r15d, %r15d
	movq	_RTL8367B_PORT_MISC_CFG_EGRESS_MODE_ORIGINAL@GOTPCREL(%rip), %r13
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	callq	_RTL8367B_PORT_MISC_CFG_REG
	movq	_RTL8367B_PORT_MISC_CFG_EGRESS_MODE_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_RTL8367B_PORT_MISC_CFG_EGRESS_MODE_SHIFT@GOTPCREL(%rip), %rcx
	movzbl	(%rcx), %ecx
	shll	%cl, %edx
	movl	(%r13), %r8d
	shll	%cl, %r8d
	movq	%r14, %rdi
	movl	%eax, %esi
	movl	%r8d, %ecx
	callq	_REG_RMW
	incl	%ebx
	cmpl	(%r12), %ebx
	jl	LBB0_10
	jmp	LBB0_11
LBB0_8:
	xorl	%r15d, %r15d
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"realtek,extif0"

L_.str.1:                               ## @.str.1
	.asciz	"realtek,extif1"

	.comm	_RTL8367B_SWC0_REG,4,2          ## @RTL8367B_SWC0_REG
	.comm	_RTL8367B_SWC0_MAX_LENGTH_MASK,4,2 ## @RTL8367B_SWC0_MAX_LENGTH_MASK
	.comm	_RTL8367B_SWC0_MAX_LENGTH_1536,4,2 ## @RTL8367B_SWC0_MAX_LENGTH_1536
	.comm	_RTL8367B_VLAN_INGRESS_REG,4,2  ## @RTL8367B_VLAN_INGRESS_REG
	.comm	_RTL8367B_PORTS_ALL,4,2         ## @RTL8367B_PORTS_ALL
	.comm	_RTL8367B_NUM_PORTS,4,2         ## @RTL8367B_NUM_PORTS
	.comm	_RTL8367B_PORT_MISC_CFG_EGRESS_MODE_MASK,4,2 ## @RTL8367B_PORT_MISC_CFG_EGRESS_MODE_MASK
	.comm	_RTL8367B_PORT_MISC_CFG_EGRESS_MODE_SHIFT,4,2 ## @RTL8367B_PORT_MISC_CFG_EGRESS_MODE_SHIFT
	.comm	_RTL8367B_PORT_MISC_CFG_EGRESS_MODE_ORIGINAL,4,2 ## @RTL8367B_PORT_MISC_CFG_EGRESS_MODE_ORIGINAL
	.no_dead_strip	_rtl8367b_setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rtl8367b_setup
_rtl8367b_setup:                        ; @rtl8367b_setup
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
	ldr	x8, [x0]
	ldr	x20, [x8, #8]
	bl	_rtl8367b_init_regs
	cbz	w0, LBB0_2
LBB0_1:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_2:
	ldr	x8, [x19]
	ldr	x8, [x8]
	cbz	x8, LBB0_5
; %bb.3:
Lloh0:
	adrp	x2, l_.str@PAGE
Lloh1:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	mov	w1, #0
	bl	_rtl8367b_extif_init_of
	cbnz	w0, LBB0_1
; %bb.4:
Lloh2:
	adrp	x2, l_.str.1@PAGE
Lloh3:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	w1, #1
	bl	_rtl8367b_extif_init_of
	cbnz	w0, LBB0_1
	b	LBB0_7
LBB0_5:
	ldr	w2, [x20, #4]
	mov	x0, x19
	mov	w1, #0
	bl	_rtl8367b_extif_init
	cbnz	w0, LBB0_1
; %bb.6:
	ldr	w2, [x20]
	mov	x0, x19
	mov	w1, #1
	bl	_rtl8367b_extif_init
	cbnz	w0, LBB0_1
LBB0_7:
Lloh4:
	adrp	x8, _RTL8367B_SWC0_REG@GOTPAGE
Lloh5:
	ldr	x8, [x8, _RTL8367B_SWC0_REG@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
Lloh7:
	adrp	x8, _RTL8367B_SWC0_MAX_LENGTH_MASK@GOTPAGE
Lloh8:
	ldr	x8, [x8, _RTL8367B_SWC0_MAX_LENGTH_MASK@GOTPAGEOFF]
Lloh9:
	ldr	w2, [x8]
Lloh10:
	adrp	x8, _RTL8367B_SWC0_MAX_LENGTH_1536@GOTPAGE
Lloh11:
	ldr	x8, [x8, _RTL8367B_SWC0_MAX_LENGTH_1536@GOTPAGEOFF]
Lloh12:
	ldr	w3, [x8]
	mov	x0, x19
	bl	_REG_RMW
Lloh13:
	adrp	x8, _RTL8367B_VLAN_INGRESS_REG@GOTPAGE
Lloh14:
	ldr	x8, [x8, _RTL8367B_VLAN_INGRESS_REG@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
Lloh16:
	adrp	x8, _RTL8367B_PORTS_ALL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _RTL8367B_PORTS_ALL@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_REG_WR
Lloh19:
	adrp	x21, _RTL8367B_NUM_PORTS@GOTPAGE
Lloh20:
	ldr	x21, [x21, _RTL8367B_NUM_PORTS@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.8:
	mov	w20, #0
Lloh21:
	adrp	x22, _RTL8367B_PORT_MISC_CFG_EGRESS_MODE_MASK@GOTPAGE
Lloh22:
	ldr	x22, [x22, _RTL8367B_PORT_MISC_CFG_EGRESS_MODE_MASK@GOTPAGEOFF]
Lloh23:
	adrp	x23, _RTL8367B_PORT_MISC_CFG_EGRESS_MODE_SHIFT@GOTPAGE
Lloh24:
	ldr	x23, [x23, _RTL8367B_PORT_MISC_CFG_EGRESS_MODE_SHIFT@GOTPAGEOFF]
Lloh25:
	adrp	x24, _RTL8367B_PORT_MISC_CFG_EGRESS_MODE_ORIGINAL@GOTPAGE
Lloh26:
	ldr	x24, [x24, _RTL8367B_PORT_MISC_CFG_EGRESS_MODE_ORIGINAL@GOTPAGEOFF]
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_RTL8367B_PORT_MISC_CFG_REG
	mov	x1, x0
	ldr	w8, [x22]
	ldr	w9, [x23]
	lsl	w2, w8, w9
	ldr	w8, [x24]
	lsl	w3, w8, w9
	mov	x0, x19
	bl	_REG_RMW
	add	w20, w20, #1
	ldr	w8, [x21]
	cmp	w20, w8
	b.lt	LBB0_9
LBB0_10:
	mov	w0, #0
	b	LBB0_1
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"realtek,extif0"

l_.str.1:                               ; @.str.1
	.asciz	"realtek,extif1"

	.comm	_RTL8367B_SWC0_REG,4,2          ; @RTL8367B_SWC0_REG
	.comm	_RTL8367B_SWC0_MAX_LENGTH_MASK,4,2 ; @RTL8367B_SWC0_MAX_LENGTH_MASK
	.comm	_RTL8367B_SWC0_MAX_LENGTH_1536,4,2 ; @RTL8367B_SWC0_MAX_LENGTH_1536
	.comm	_RTL8367B_VLAN_INGRESS_REG,4,2  ; @RTL8367B_VLAN_INGRESS_REG
	.comm	_RTL8367B_PORTS_ALL,4,2         ; @RTL8367B_PORTS_ALL
	.comm	_RTL8367B_NUM_PORTS,4,2         ; @RTL8367B_NUM_PORTS
	.comm	_RTL8367B_PORT_MISC_CFG_EGRESS_MODE_MASK,4,2 ; @RTL8367B_PORT_MISC_CFG_EGRESS_MODE_MASK
	.comm	_RTL8367B_PORT_MISC_CFG_EGRESS_MODE_SHIFT,4,2 ; @RTL8367B_PORT_MISC_CFG_EGRESS_MODE_SHIFT
	.comm	_RTL8367B_PORT_MISC_CFG_EGRESS_MODE_ORIGINAL,4,2 ; @RTL8367B_PORT_MISC_CFG_EGRESS_MODE_ORIGINAL
	.no_dead_strip	_rtl8367b_setup
.subsections_via_symbols
