	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ksz9477_config_cpu_port
_ksz9477_config_cpu_port:               ## @ksz9477_config_cpu_port
	.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	8(%rdi), %r15
	movl	(%r15), %eax
	movl	%eax, (%rdi)
	testl	%eax, %eax
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	jle	LBB0_11
## %bb.1:
	movq	%rdi, %r14
	xorl	%ebx, %ebx
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	$1, %edx
	callq	_ksz9477_port_setup
	movq	48(%r15), %rax
	movslq	8(%r15), %rcx
	movl	16(%r15), %edx
	leaq	(%rcx,%rcx,4), %rcx
	movl	%edx, (%rax,%rcx,4)
	movl	$1, 4(%rax,%rcx,4)
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	incl	%ebx
	cmpl	(%r15), %ebx
	jge	LBB0_11
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_dsa_is_cpu_port
	testq	%rax, %rax
	je	LBB0_10
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	4(%r15), %edx
	movl	$1, %eax
	movl	%ebx, %ecx
	shll	%cl, %eax
	btl	%ebx, %edx
	jae	LBB0_10
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%ebx, 8(%r15)
	movl	%eax, 12(%r15)
	orl	%eax, 16(%r15)
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_ksz9477_get_interface
	movq	%rax, %r13
	movq	24(%r15), %rdi
	testq	%rdi, %rdi
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r13, 24(%r15)
	movq	%r13, %rdi
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	testq	%r13, %r13
	je	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpq	%rdi, %r13
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	56(%r15), %r12d
	callq	_phy_modes
	movl	%eax, %r14d
	movq	%r13, %rdi
	callq	_phy_modes
	movl	%r12d, %edi
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edx
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movl	%eax, %ecx
	callq	_dev_info
	jmp	LBB0_9
LBB0_11:
	movl	12(%r15), %eax
	movl	%eax, 32(%r15)
	cmpl	$0, 36(%r15)
	jle	LBB0_20
## %bb.12:
	movl	$12, %r14d
	xorl	%ebx, %ebx
	movq	_BR_STATE_DISABLED@GOTPCREL(%rip), %r12
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_13 Depth=1
	incq	%rbx
	movslq	36(%r15), %rax
	addq	$20, %r14
	cmpq	%rax, %rbx
	jge	LBB0_20
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movl	8(%r15), %eax
	cmpq	%rax, %rbx
	je	LBB0_19
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	movq	48(%r15), %r13
	movl	$1, %eax
	movl	%ebx, %ecx
	shll	%cl, %eax
	movl	%eax, -12(%r13,%r14)
	movl	16(%r15), %eax
	movl	%eax, -4(%r13,%r14)
	movl	(%r12), %edx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %esi
	callq	_ksz9477_port_stp_state_set
	movl	$1, -8(%r13,%r14)
	movslq	40(%r15), %rax
	cmpq	%rax, %rbx
	jge	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_13 Depth=1
	movl	$1, (%r13,%r14)
LBB0_16:                                ##   in Loop: Header=BB0_13 Depth=1
	cmpl	$9729792, 44(%r15)              ## imm = 0x947700
	jne	LBB0_19
## %bb.17:                              ##   in Loop: Header=BB0_13 Depth=1
	cmpq	$6, %rbx
	jne	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_13 Depth=1
	movabsq	$4294967296, %rax               ## imm = 0x100000000
	movq	%rax, 132(%r13)
	jmp	LBB0_19
LBB0_20:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"use %s instead of %s\n"

	.comm	_BR_STATE_DISABLED,4,2          ## @BR_STATE_DISABLED
	.no_dead_strip	_ksz9477_config_cpu_port
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function ksz9477_config_cpu_port
lCPI0_0:
	.long	0                               ; 0x0
	.long	1                               ; 0x1
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_ksz9477_config_cpu_port:               ; @ksz9477_config_cpu_port
	.cfi_startproc
; %bb.0:
	stp	d9, d8, [sp, #-112]!            ; 16-byte Folded Spill
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	.cfi_offset b8, -104
	.cfi_offset b9, -112
	mov	x19, x0
	ldr	x20, [x0, #8]
	ldr	w8, [x20]
	str	w8, [x0]
	cmp	w8, #1
	b.lt	LBB0_11
; %bb.1:
	mov	w21, #0
	mov	w26, #1
	mov	w27, #20
Lloh0:
	adrp	x22, l_.str@PAGE
Lloh1:
	add	x22, x22, l_.str@PAGEOFF
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x20
	mov	x1, x21
	mov	w2, #1
	bl	_ksz9477_port_setup
	ldr	x8, [x20, #48]
	ldrsw	x9, [x20, #8]
	ldr	w10, [x20, #16]
	madd	x8, x9, x27, x8
	stp	w10, w26, [x8]
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	w21, w21, #1
	ldr	w8, [x20]
	cmp	w21, w8
	b.ge	LBB0_11
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x21
	bl	_dsa_is_cpu_port
	cbz	x0, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w9, [x20, #4]
	lsl	w8, w26, w21
	tst	w9, w8
	b.eq	LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	stp	w21, w8, [x20, #8]
	ldr	w9, [x20, #16]
	orr	w8, w9, w8
	str	w8, [x20, #16]
	mov	x0, x20
	mov	x1, x21
	bl	_ksz9477_get_interface
	mov	x23, x0
	ldr	x0, [x20, #24]
	cbnz	x0, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	str	x23, [x20, #24]
	mov	x0, x23
LBB0_8:                                 ;   in Loop: Header=BB0_4 Depth=1
	cbz	x23, LBB0_2
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	x23, x0
	b.eq	LBB0_2
; %bb.10:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	w24, [x20, #56]
	bl	_phy_modes
	mov	x25, x0
	mov	x0, x23
	bl	_phy_modes
	mov	x3, x0
	mov	x0, x24
	mov	x1, x22
	mov	x2, x25
	bl	_dev_info
	b	LBB0_2
LBB0_11:
	ldr	w8, [x20, #12]
	str	w8, [x20, #32]
	ldr	w8, [x20, #36]
	cmp	w8, #1
	b.lt	LBB0_19
; %bb.12:
	mov	x22, #0
	mov	x21, #0
	mov	w23, #1
Lloh2:
	adrp	x24, _BR_STATE_DISABLED@GOTPAGE
Lloh3:
	ldr	x24, [x24, _BR_STATE_DISABLED@GOTPAGEOFF]
Lloh4:
	adrp	x8, lCPI0_0@PAGE
Lloh5:
	ldr	d8, [x8, lCPI0_0@PAGEOFF]
	mov	w25, #30464
	movk	w25, #148, lsl #16
	b	LBB0_14
LBB0_13:                                ;   in Loop: Header=BB0_14 Depth=1
	add	x21, x21, #1
	ldrsw	x8, [x20, #36]
	add	x22, x22, #20
	cmp	x21, x8
	b.ge	LBB0_19
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x20, #8]
	cmp	x21, x8
	b.eq	LBB0_13
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	x26, [x20, #48]
	lsl	w8, w23, w21
	add	x27, x26, x22
	str	w8, [x27]
	ldr	w8, [x20, #16]
	str	w8, [x27, #8]
	ldr	w2, [x24]
	mov	x0, x19
	mov	x1, x21
	bl	_ksz9477_port_stp_state_set
	str	w23, [x27, #4]
	ldrsw	x8, [x20, #40]
	cmp	x21, x8
	b.ge	LBB0_17
; %bb.16:                               ;   in Loop: Header=BB0_14 Depth=1
	str	w23, [x27, #12]
LBB0_17:                                ;   in Loop: Header=BB0_14 Depth=1
	ldr	w8, [x20, #44]
	cmp	w8, w25
	ccmp	x21, #6, #0, eq
	b.ne	LBB0_13
; %bb.18:                               ;   in Loop: Header=BB0_14 Depth=1
	stur	d8, [x26, #132]
	b	LBB0_13
LBB0_19:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp], #112              ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdr	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"use %s instead of %s\n"

	.comm	_BR_STATE_DISABLED,4,2          ; @BR_STATE_DISABLED
	.no_dead_strip	_ksz9477_config_cpu_port
.subsections_via_symbols
