	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mt7531_sw_detect
_mt7531_sw_detect:                      ## @mt7531_sw_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	_CHIP_REV@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_mt753x_reg_read
	movl	%eax, %ebx
	movq	_CHIP_NAME_M@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%ebx, %eax
	movq	_CHIP_NAME_S@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	movq	_MT7531@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_3
## %bb.1:
	xorl	%r12d, %r12d
	testq	%r14, %r14
	je	LBB0_4
## %bb.2:
	movq	_TOP_SIG_SR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_mt753x_reg_read
	movq	_CHIP_REV_M@GOTPCREL(%rip), %rcx
	andl	(%rcx), %ebx
	movl	%ebx, (%r14)
	movq	_PAD_DUAL_SGMII_EN@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	leaq	L_.str.1(%rip), %rax
	leaq	L_.str(%rip), %rcx
	cmoveq	%rax, %rcx
	movq	%rcx, 8(%r14)
	jmp	LBB0_4
LBB0_3:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
LBB0_4:
	movl	%r12d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CHIP_REV,4,2                   ## @CHIP_REV
	.comm	_CHIP_NAME_M,4,2                ## @CHIP_NAME_M
	.comm	_CHIP_NAME_S,4,2                ## @CHIP_NAME_S
	.comm	_MT7531,4,2                     ## @MT7531
	.comm	_TOP_SIG_SR,4,2                 ## @TOP_SIG_SR
	.comm	_CHIP_REV_M,4,2                 ## @CHIP_REV_M
	.comm	_PAD_DUAL_SGMII_EN,4,2          ## @PAD_DUAL_SGMII_EN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"MT7531AE"

L_.str.1:                               ## @.str.1
	.asciz	"MT7531BE"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.no_dead_strip	_mt7531_sw_detect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mt7531_sw_detect
_mt7531_sw_detect:                      ; @mt7531_sw_detect
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _CHIP_REV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CHIP_REV@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_mt753x_reg_read
Lloh3:
	adrp	x8, _CHIP_NAME_M@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CHIP_NAME_M@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh6:
	adrp	x9, _CHIP_NAME_S@GOTPAGE
Lloh7:
	ldr	x9, [x9, _CHIP_NAME_S@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	asr	w8, w8, w9
Lloh9:
	adrp	x9, _MT7531@GOTPAGE
Lloh10:
	ldr	x9, [x9, _MT7531@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_3
; %bb.1:
	cbz	x19, LBB0_4
; %bb.2:
	mov	x21, x0
Lloh12:
	adrp	x8, _TOP_SIG_SR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _TOP_SIG_SR@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_mt753x_reg_read
	mov	x8, x0
	mov	w0, #0
Lloh15:
	adrp	x9, _CHIP_REV_M@GOTPAGE
Lloh16:
	ldr	x9, [x9, _CHIP_REV_M@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	and	w9, w9, w21
	str	w9, [x19]
Lloh18:
	adrp	x9, _PAD_DUAL_SGMII_EN@GOTPAGE
Lloh19:
	ldr	x9, [x9, _PAD_DUAL_SGMII_EN@GOTPAGEOFF]
Lloh20:
	adrp	x10, l_.str@PAGE
Lloh21:
	add	x10, x10, l_.str@PAGEOFF
Lloh22:
	ldr	w9, [x9]
Lloh23:
	adrp	x11, l_.str.1@PAGE
Lloh24:
	add	x11, x11, l_.str.1@PAGEOFF
	tst	w9, w8
	csel	x8, x11, x10, eq
	str	x8, [x19, #8]
	b	LBB0_5
LBB0_3:
Lloh25:
	adrp	x8, _ENODEV@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_5
LBB0_4:
	mov	w0, #0
LBB0_5:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh22
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_CHIP_REV,4,2                   ; @CHIP_REV
	.comm	_CHIP_NAME_M,4,2                ; @CHIP_NAME_M
	.comm	_CHIP_NAME_S,4,2                ; @CHIP_NAME_S
	.comm	_MT7531,4,2                     ; @MT7531
	.comm	_TOP_SIG_SR,4,2                 ; @TOP_SIG_SR
	.comm	_CHIP_REV_M,4,2                 ; @CHIP_REV_M
	.comm	_PAD_DUAL_SGMII_EN,4,2          ; @PAD_DUAL_SGMII_EN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"MT7531AE"

l_.str.1:                               ; @.str.1
	.asciz	"MT7531BE"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.no_dead_strip	_mt7531_sw_detect
.subsections_via_symbols
