	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ksz8795_switch_detect
_ksz8795_switch_detect:                 ## @ksz8795_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movq	_REG_CHIP_ID0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-12(%rbp), %rdx
	callq	_ksz_read16
	testl	%eax, %eax
	jne	LBB0_10
## %bb.1:
	movl	-12(%rbp), %eax
	movl	%eax, %ecx
	sarl	$8, %ecx
	movq	_FAMILY_ID@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jne	LBB0_4
## %bb.2:
	movq	_SW_CHIP_ID_M@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%eax, %ecx
	movq	_CHIP_ID_94@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r8d
	movq	_CHIP_ID_95@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	cmpl	%r8d, %ecx
	je	LBB0_5
## %bb.3:
	cmpl	%esi, %ecx
	je	LBB0_5
LBB0_4:
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_10
LBB0_5:
	movq	_TOTAL_PORT_NUM@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdi
	movq	%rdi, 24(%rbx)
	movq	_SWITCH_PORT_NUM@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	%rdx, 48(%rbx)
	movq	%rdx, 32(%rbx)
	cmpl	%esi, %ecx
	jne	LBB0_7
## %bb.6:
	movq	_REG_PORT_1_STATUS_0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-16(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_ksz_read8
	movq	_PORT_FIBER_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	-16(%rbp), %eax
	movl	$149, %eax
	movl	$101, %ecx
	cmovel	%eax, %ecx
	movl	-12(%rbp), %eax
	movq	24(%rbx), %rdi
	jmp	LBB0_9
LBB0_7:
	cmpl	%r8d, %ecx
	jne	LBB0_9
## %bb.8:
	decq	%rdx
	movq	%rdx, 32(%rbx)
	movq	%rdx, 40(%rbx)
	movl	$148, %ecx
LBB0_9:
	andl	$-256, %eax
	orl	%ecx, %eax
	movl	%eax, -12(%rbp)
	movl	%eax, (%rbx)
	decq	%rdi
	movq	%rdi, 8(%rbx)
	callq	_BIT
	movl	%eax, 16(%rbx)
	xorl	%eax, %eax
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_REG_CHIP_ID0,4,2               ## @REG_CHIP_ID0
	.comm	_SW_CHIP_ID_M,4,2               ## @SW_CHIP_ID_M
	.comm	_FAMILY_ID,4,2                  ## @FAMILY_ID
	.comm	_CHIP_ID_94,4,2                 ## @CHIP_ID_94
	.comm	_CHIP_ID_95,4,2                 ## @CHIP_ID_95
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_TOTAL_PORT_NUM,8,3             ## @TOTAL_PORT_NUM
	.comm	_SWITCH_PORT_NUM,8,3            ## @SWITCH_PORT_NUM
	.comm	_REG_PORT_1_STATUS_0,4,2        ## @REG_PORT_1_STATUS_0
	.comm	_PORT_FIBER_MODE,4,2            ## @PORT_FIBER_MODE
	.no_dead_strip	_ksz8795_switch_detect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ksz8795_switch_detect
_ksz8795_switch_detect:                 ; @ksz8795_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	x8, _REG_CHIP_ID0@GOTPAGE
Lloh1:
	ldr	x8, [x8, _REG_CHIP_ID0@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_ksz_read16
	cbnz	w0, LBB0_9
; %bb.1:
	ldr	w8, [sp, #12]
Lloh3:
	adrp	x9, _FAMILY_ID@GOTPAGE
Lloh4:
	ldr	x9, [x9, _FAMILY_ID@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w9, w8, asr #8
	b.ne	LBB0_5
; %bb.2:
Lloh6:
	adrp	x9, _SW_CHIP_ID_M@GOTPAGE
Lloh7:
	ldr	x9, [x9, _SW_CHIP_ID_M@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	and	w9, w9, w8
Lloh9:
	adrp	x10, _CHIP_ID_94@GOTPAGE
Lloh10:
	ldr	x10, [x10, _CHIP_ID_94@GOTPAGEOFF]
Lloh11:
	ldr	w11, [x10]
Lloh12:
	adrp	x10, _CHIP_ID_95@GOTPAGE
Lloh13:
	ldr	x10, [x10, _CHIP_ID_95@GOTPAGEOFF]
Lloh14:
	ldr	w12, [x10]
	cmp	w9, w11
	ccmp	w9, w12, #4, ne
	b.ne	LBB0_5
; %bb.3:
Lloh15:
	adrp	x10, _TOTAL_PORT_NUM@GOTPAGE
Lloh16:
	ldr	x10, [x10, _TOTAL_PORT_NUM@GOTPAGEOFF]
Lloh17:
	adrp	x13, _SWITCH_PORT_NUM@GOTPAGE
Lloh18:
	ldr	x13, [x13, _SWITCH_PORT_NUM@GOTPAGEOFF]
Lloh19:
	ldr	x10, [x10]
Lloh20:
	ldr	x13, [x13]
	str	x13, [x19, #48]
	stp	x10, x13, [x19, #24]
	cmp	w9, w12
	b.ne	LBB0_6
; %bb.4:
Lloh21:
	adrp	x8, _REG_PORT_1_STATUS_0@GOTPAGE
Lloh22:
	ldr	x8, [x8, _REG_PORT_1_STATUS_0@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x19
	bl	_ksz_read8
	ldr	w8, [sp, #8]
Lloh24:
	adrp	x9, _PORT_FIBER_MODE@GOTPAGE
Lloh25:
	ldr	x9, [x9, _PORT_FIBER_MODE@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	tst	w9, w8
	mov	w8, #101
	mov	w9, #149
	csel	w9, w9, w8, eq
	ldr	w8, [sp, #12]
	ldr	x10, [x19, #24]
	b	LBB0_8
LBB0_5:
Lloh27:
	adrp	x8, _ENODEV@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_9
LBB0_6:
	cmp	w9, w11
	b.ne	LBB0_8
; %bb.7:
	sub	x9, x13, #1
	stp	x9, x9, [x19, #32]
	mov	w9, #148
LBB0_8:
	and	w8, w8, #0xffffff00
	orr	w8, w8, w9
	str	w8, [sp, #12]
	str	w8, [x19]
	sub	x0, x10, #1
	str	x0, [x19, #8]
	bl	_BIT
	mov	x8, x0
	mov	w0, #0
	str	w8, [x19, #16]
LBB0_9:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh19
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_REG_CHIP_ID0,4,2               ; @REG_CHIP_ID0
	.comm	_SW_CHIP_ID_M,4,2               ; @SW_CHIP_ID_M
	.comm	_FAMILY_ID,4,2                  ; @FAMILY_ID
	.comm	_CHIP_ID_94,4,2                 ; @CHIP_ID_94
	.comm	_CHIP_ID_95,4,2                 ; @CHIP_ID_95
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_TOTAL_PORT_NUM,8,3             ; @TOTAL_PORT_NUM
	.comm	_SWITCH_PORT_NUM,8,3            ; @SWITCH_PORT_NUM
	.comm	_REG_PORT_1_STATUS_0,4,2        ; @REG_PORT_1_STATUS_0
	.comm	_PORT_FIBER_MODE,4,2            ; @PORT_FIBER_MODE
	.no_dead_strip	_ksz8795_switch_detect
.subsections_via_symbols
