	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ksz9477_switch_detect
_ksz9477_switch_detect:                 ## @ksz9477_switch_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	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movq	_REG_SW_GLOBAL_SERIAL_CTRL_0@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	leaq	-20(%rbp), %rdx
	callq	_ksz_read8
	testl	%eax, %eax
	jne	LBB0_11
## %bb.1:
	movq	_SPI_AUTO_EDGE_DETECTION@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	notl	%edx
	andl	-20(%rbp), %edx
	movl	%edx, -20(%rbp)
	movl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_ksz_write8
	testl	%eax, %eax
	jne	LBB0_11
## %bb.2:
	movq	_REG_CHIP_ID0__1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-24(%rbp), %rdx
	movq	%r14, %rdi
	callq	_ksz_read32
	testl	%eax, %eax
	jne	LBB0_11
## %bb.3:
	movq	_REG_GLOBAL_OPTIONS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-20(%rbp), %rdx
	movq	%r14, %rdi
	callq	_ksz_read8
	testl	%eax, %eax
	jne	LBB0_11
## %bb.4:
	movq	_TOTAL_PORT_NUM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
	movl	$5, 4(%r14)
	movq	_GBIT_SUPPORT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	-24(%rbp), %eax
	movl	%eax, %edx
	andl	$3840, %edx                     ## imm = 0xF00
	cmpl	$768, %edx                      ## imm = 0x300
	jne	LBB0_8
## %bb.5:
	movq	_IS_9893@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%edx, %esi
	orl	%ecx, %esi
	movl	%esi, 12(%r14)
	movq	_SW_QW_ABLE@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	testl	%esi, -20(%rbp)
	je	LBB0_7
## %bb.6:
	notl	%ecx
	andl	%ecx, %edx
	movl	%edx, 12(%r14)
LBB0_7:
	movabsq	$8589934595, %rcx               ## imm = 0x200000003
	movq	%rcx, (%r14)
	jmp	LBB0_10
LBB0_8:
	movq	_NEW_XMII@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%edx, %esi
	orl	%ecx, %esi
	movl	%esi, 12(%r14)
	movq	_SW_GIGABIT_ABLE@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	testl	%esi, -20(%rbp)
	jne	LBB0_10
## %bb.9:
	notl	%ecx
	andl	%ecx, %edx
	movl	%edx, 12(%r14)
LBB0_10:
	andl	$-256, %eax
	movl	%eax, 8(%r14)
	xorl	%eax, %eax
LBB0_11:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_REG_SW_GLOBAL_SERIAL_CTRL_0,4,2 ## @REG_SW_GLOBAL_SERIAL_CTRL_0
	.comm	_SPI_AUTO_EDGE_DETECTION,4,2    ## @SPI_AUTO_EDGE_DETECTION
	.comm	_REG_CHIP_ID0__1,4,2            ## @REG_CHIP_ID0__1
	.comm	_REG_GLOBAL_OPTIONS,4,2         ## @REG_GLOBAL_OPTIONS
	.comm	_TOTAL_PORT_NUM,4,2             ## @TOTAL_PORT_NUM
	.comm	_GBIT_SUPPORT,4,2               ## @GBIT_SUPPORT
	.comm	_IS_9893,4,2                    ## @IS_9893
	.comm	_SW_QW_ABLE,4,2                 ## @SW_QW_ABLE
	.comm	_NEW_XMII,4,2                   ## @NEW_XMII
	.comm	_SW_GIGABIT_ABLE,4,2            ## @SW_GIGABIT_ABLE
	.no_dead_strip	_ksz9477_switch_detect
.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_switch_detect
lCPI0_0:
	.long	3                               ; 0x3
	.long	2                               ; 0x2
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_ksz9477_switch_detect:                 ; @ksz9477_switch_detect
	.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
	mov	x19, x0
Lloh0:
	adrp	x20, _REG_SW_GLOBAL_SERIAL_CTRL_0@GOTPAGE
Lloh1:
	ldr	x20, [x20, _REG_SW_GLOBAL_SERIAL_CTRL_0@GOTPAGEOFF]
	ldr	w1, [x20]
	add	x2, sp, #12
	bl	_ksz_read8
	cbnz	w0, LBB0_11
; %bb.1:
Lloh2:
	adrp	x8, _SPI_AUTO_EDGE_DETECTION@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SPI_AUTO_EDGE_DETECTION@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	ldr	w9, [sp, #12]
	bic	w2, w9, w8
	str	w2, [sp, #12]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_ksz_write8
	cbnz	w0, LBB0_11
; %bb.2:
Lloh5:
	adrp	x8, _REG_CHIP_ID0__1@GOTPAGE
Lloh6:
	ldr	x8, [x8, _REG_CHIP_ID0__1@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x19
	bl	_ksz_read32
	cbnz	w0, LBB0_11
; %bb.3:
Lloh8:
	adrp	x8, _REG_GLOBAL_OPTIONS@GOTPAGE
Lloh9:
	ldr	x8, [x8, _REG_GLOBAL_OPTIONS@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x19
	bl	_ksz_read8
	cbnz	w0, LBB0_11
; %bb.4:
Lloh11:
	adrp	x8, _TOTAL_PORT_NUM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _TOTAL_PORT_NUM@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	mov	w9, #5
	stp	w8, w9, [x19]
Lloh14:
	adrp	x8, _GBIT_SUPPORT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _GBIT_SUPPORT@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x8]
	ldr	w8, [sp, #8]
	and	w10, w8, #0xf00
	cmp	w10, #768
	b.ne	LBB0_8
; %bb.5:
Lloh17:
	adrp	x10, _IS_9893@GOTPAGE
Lloh18:
	ldr	x10, [x10, _IS_9893@GOTPAGEOFF]
Lloh19:
	ldr	w10, [x10]
	orr	w11, w10, w9
	str	w11, [x19, #12]
	ldr	w11, [sp, #12]
Lloh20:
	adrp	x12, _SW_QW_ABLE@GOTPAGE
Lloh21:
	ldr	x12, [x12, _SW_QW_ABLE@GOTPAGEOFF]
Lloh22:
	ldr	w12, [x12]
	tst	w12, w11
	b.eq	LBB0_7
; %bb.6:
	bic	w9, w10, w9
	str	w9, [x19, #12]
LBB0_7:
Lloh23:
	adrp	x9, lCPI0_0@PAGE
Lloh24:
	ldr	d0, [x9, lCPI0_0@PAGEOFF]
	str	d0, [x19]
	b	LBB0_10
LBB0_8:
Lloh25:
	adrp	x10, _NEW_XMII@GOTPAGE
Lloh26:
	ldr	x10, [x10, _NEW_XMII@GOTPAGEOFF]
Lloh27:
	ldr	w10, [x10]
	orr	w11, w10, w9
	str	w11, [x19, #12]
	ldr	w11, [sp, #12]
Lloh28:
	adrp	x12, _SW_GIGABIT_ABLE@GOTPAGE
Lloh29:
	ldr	x12, [x12, _SW_GIGABIT_ABLE@GOTPAGEOFF]
Lloh30:
	ldr	w12, [x12]
	tst	w12, w11
	b.ne	LBB0_10
; %bb.9:
	bic	w9, w10, w9
	str	w9, [x19, #12]
LBB0_10:
	mov	w0, #0
	and	w8, w8, #0xffffff00
	str	w8, [x19, #8]
LBB0_11:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdr	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_REG_SW_GLOBAL_SERIAL_CTRL_0,4,2 ; @REG_SW_GLOBAL_SERIAL_CTRL_0
	.comm	_SPI_AUTO_EDGE_DETECTION,4,2    ; @SPI_AUTO_EDGE_DETECTION
	.comm	_REG_CHIP_ID0__1,4,2            ; @REG_CHIP_ID0__1
	.comm	_REG_GLOBAL_OPTIONS,4,2         ; @REG_GLOBAL_OPTIONS
	.comm	_TOTAL_PORT_NUM,4,2             ; @TOTAL_PORT_NUM
	.comm	_GBIT_SUPPORT,4,2               ; @GBIT_SUPPORT
	.comm	_IS_9893,4,2                    ; @IS_9893
	.comm	_SW_QW_ABLE,4,2                 ; @SW_QW_ABLE
	.comm	_NEW_XMII,4,2                   ; @NEW_XMII
	.comm	_SW_GIGABIT_ABLE,4,2            ; @SW_GIGABIT_ABLE
	.no_dead_strip	_ksz9477_switch_detect
.subsections_via_symbols
