	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mv88e6xxx_detect
_mv88e6xxx_detect:                      ## @mv88e6xxx_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	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	callq	_mv88e6xxx_reg_lock
	movq	_MV88E6XXX_PORT_SWITCH_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-28(%rbp), %rcx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_mv88e6xxx_port_read
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_mv88e6xxx_reg_unlock
	testl	%ebx, %ebx
	je	LBB0_1
LBB0_5:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movl	-28(%rbp), %r14d
	movq	_MV88E6XXX_PORT_SWITCH_ID_PROD_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	andl	%r14d, %edi
	movq	_MV88E6XXX_PORT_SWITCH_ID_REV_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %r14d
	callq	_mv88e6xxx_lookup_info
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	%rax, (%r15)
	movq	%r15, %rdi
	callq	_mv88e6xxx_g2_require
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:
	movl	8(%r15), %edi
	movq	(%r15), %rax
	movl	(%rax), %ecx
	movl	4(%rax), %edx
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %r8d
	callq	_dev_info
	xorl	%ebx, %ebx
	jmp	LBB0_5
LBB0_2:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_MV88E6XXX_PORT_SWITCH_ID,4,2   ## @MV88E6XXX_PORT_SWITCH_ID
	.comm	_MV88E6XXX_PORT_SWITCH_ID_PROD_MASK,4,2 ## @MV88E6XXX_PORT_SWITCH_ID_PROD_MASK
	.comm	_MV88E6XXX_PORT_SWITCH_ID_REV_MASK,4,2 ## @MV88E6XXX_PORT_SWITCH_ID_REV_MASK
	.comm	_ENODEV,4,2                     ## @ENODEV
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"switch 0x%x detected: %s, revision %u\n"

	.no_dead_strip	_mv88e6xxx_detect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mv88e6xxx_detect
_mv88e6xxx_detect:                      ; @mv88e6xxx_detect
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
	bl	_mv88e6xxx_reg_lock
Lloh0:
	adrp	x8, _MV88E6XXX_PORT_SWITCH_ID@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MV88E6XXX_PORT_SWITCH_ID@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	add	x3, sp, #12
	mov	x0, x19
	mov	w1, #0
	bl	_mv88e6xxx_port_read
	mov	x20, x0
	mov	x0, x19
	bl	_mv88e6xxx_reg_unlock
	cbz	w20, LBB0_2
LBB0_1:
	mov	x0, x20
	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
	add	sp, sp, #64
	ret
LBB0_2:
Lloh3:
	adrp	x8, _MV88E6XXX_PORT_SWITCH_ID_PROD_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MV88E6XXX_PORT_SWITCH_ID_PROD_MASK@GOTPAGEOFF]
	ldr	w21, [sp, #12]
Lloh5:
	ldr	w8, [x8]
	and	w0, w8, w21
Lloh6:
	adrp	x8, _MV88E6XXX_PORT_SWITCH_ID_REV_MASK@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MV88E6XXX_PORT_SWITCH_ID_REV_MASK@GOTPAGEOFF]
Lloh8:
	ldr	w22, [x8]
	bl	_mv88e6xxx_lookup_info
	cbz	x0, LBB0_5
; %bb.3:
	str	x0, [x19]
	mov	x0, x19
	bl	_mv88e6xxx_g2_require
	mov	x20, x0
	cbnz	w0, LBB0_1
; %bb.4:
	and	w4, w22, w21
	ldr	w0, [x19, #8]
	ldr	x8, [x19]
	ldp	w3, w2, [x8]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_info
	b	LBB0_1
LBB0_5:
Lloh11:
	adrp	x8, _ENODEV@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_1
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_MV88E6XXX_PORT_SWITCH_ID,4,2   ; @MV88E6XXX_PORT_SWITCH_ID
	.comm	_MV88E6XXX_PORT_SWITCH_ID_PROD_MASK,4,2 ; @MV88E6XXX_PORT_SWITCH_ID_PROD_MASK
	.comm	_MV88E6XXX_PORT_SWITCH_ID_REV_MASK,4,2 ; @MV88E6XXX_PORT_SWITCH_ID_REV_MASK
	.comm	_ENODEV,4,2                     ; @ENODEV
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"switch 0x%x detected: %s, revision %u\n"

	.no_dead_strip	_mv88e6xxx_detect
.subsections_via_symbols
