	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mt7530_phylink_mac_link_state
_mt7530_phylink_mac_link_state:         ## @mt7530_phylink_mac_link_state
	.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
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	testl	%esi, %esi
	js	LBB0_2
## %bb.1:
	movq	_MT7530_NUM_PORTS@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jle	LBB0_2
## %bb.3:
	movq	%rdx, %rbx
	movq	(%rdi), %r14
	movl	%esi, %edi
	callq	_MT7530_PMSR_P
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_mt7530_read
	movq	_PMSR_LINK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%eax, %ecx
	movl	%ecx, (%rbx)
	movl	%ecx, 4(%rbx)
	movq	_PMSR_DPX@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	movl	(%rcx), %ecx
	andl	%eax, %ecx
	setne	%dl
	movl	%edx, 8(%rbx)
	movq	_PMSR_SPEED_MASK@GOTPCREL(%rip), %rdx
	movl	%eax, %ecx
	andl	(%rdx), %ecx
	addl	$-128, %ecx
	cmpl	$2, %ecx
	ja	LBB0_4
## %bb.5:
	movslq	%ecx, %rcx
	leaq	l_switch.table.mt7530_phylink_mac_link_state(%rip), %rdx
	movq	(%rdx,%rcx,8), %rcx
	jmp	LBB0_6
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	jmp	LBB0_10
LBB0_4:
	movq	_SPEED_UNKNOWN@GOTPCREL(%rip), %rcx
LBB0_6:
	movl	(%rcx), %ecx
	movl	%ecx, 16(%rbx)
	movq	_MLO_PAUSE_RX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_MLO_PAUSE_TX@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%edx, %esi
	orl	%ecx, %esi
	notl	%esi
	andl	12(%rbx), %esi
	movl	%esi, 12(%rbx)
	movq	_PMSR_RX_FC@GOTPCREL(%rip), %rdi
	testl	%eax, (%rdi)
	je	LBB0_8
## %bb.7:
	orl	%ecx, %esi
	movl	%esi, 12(%rbx)
LBB0_8:
	movq	_PMSR_TX_FC@GOTPCREL(%rip), %rdi
	movl	$1, %ecx
	testl	%eax, (%rdi)
	je	LBB0_10
## %bb.9:
	orl	%edx, %esi
	movl	%esi, 12(%rbx)
LBB0_10:
	movl	%ecx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MT7530_NUM_PORTS,4,2           ## @MT7530_NUM_PORTS
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PMSR_LINK,4,2                  ## @PMSR_LINK
	.comm	_PMSR_DPX,4,2                   ## @PMSR_DPX
	.comm	_PMSR_SPEED_MASK,4,2            ## @PMSR_SPEED_MASK
	.comm	_SPEED_10,4,2                   ## @SPEED_10
	.comm	_SPEED_100,4,2                  ## @SPEED_100
	.comm	_SPEED_1000,4,2                 ## @SPEED_1000
	.comm	_SPEED_UNKNOWN,4,2              ## @SPEED_UNKNOWN
	.comm	_MLO_PAUSE_RX,4,2               ## @MLO_PAUSE_RX
	.comm	_MLO_PAUSE_TX,4,2               ## @MLO_PAUSE_TX
	.comm	_PMSR_RX_FC,4,2                 ## @PMSR_RX_FC
	.comm	_PMSR_TX_FC,4,2                 ## @PMSR_TX_FC
	.no_dead_strip	_mt7530_phylink_mac_link_state
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.mt7530_phylink_mac_link_state
l_switch.table.mt7530_phylink_mac_link_state:
	.quad	_SPEED_1000
	.quad	_SPEED_100
	.quad	_SPEED_10

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mt7530_phylink_mac_link_state
_mt7530_phylink_mac_link_state:         ; @mt7530_phylink_mac_link_state
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	tbnz	w1, #31, LBB0_4
; %bb.1:
Lloh0:
	adrp	x8, _MT7530_NUM_PORTS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MT7530_NUM_PORTS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	b.le	LBB0_4
; %bb.2:
	mov	x19, x2
	ldr	x20, [x0]
	mov	x0, x1
	bl	_MT7530_PMSR_P
	mov	x1, x0
	mov	x0, x20
	bl	_mt7530_read
Lloh3:
	adrp	x8, _PMSR_LINK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PMSR_LINK@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	and	w8, w8, w0
	stp	w8, w8, [x19]
Lloh6:
	adrp	x8, _PMSR_DPX@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PMSR_DPX@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	tst	w8, w0
	cset	w8, ne
	str	w8, [x19, #8]
Lloh9:
	adrp	x8, _PMSR_SPEED_MASK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PMSR_SPEED_MASK@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	and	w8, w8, w0
	sub	w8, w8, #128
	cmp	w8, #2
	b.hi	LBB0_5
; %bb.3:
Lloh12:
	adrp	x9, l_switch.table.mt7530_phylink_mac_link_state@PAGE
Lloh13:
	add	x9, x9, l_switch.table.mt7530_phylink_mac_link_state@PAGEOFF
	ldr	x8, [x9, w8, sxtw #3]
	b	LBB0_6
LBB0_4:
Lloh14:
	adrp	x8, _EINVAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_11
LBB0_5:
Lloh17:
	adrp	x8, _SPEED_UNKNOWN@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SPEED_UNKNOWN@GOTPAGEOFF]
LBB0_6:
	ldr	w11, [x8]
Lloh19:
	adrp	x8, _MLO_PAUSE_RX@GOTPAGE
Lloh20:
	ldr	x8, [x8, _MLO_PAUSE_RX@GOTPAGEOFF]
Lloh21:
	ldr	w10, [x8]
Lloh22:
	adrp	x8, _MLO_PAUSE_TX@GOTPAGE
Lloh23:
	ldr	x8, [x8, _MLO_PAUSE_TX@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	orr	w9, w8, w10
	ldr	w12, [x19, #12]
	bic	w9, w12, w9
	stp	w9, w11, [x19, #12]
Lloh25:
	adrp	x11, _PMSR_RX_FC@GOTPAGE
Lloh26:
	ldr	x11, [x11, _PMSR_RX_FC@GOTPAGEOFF]
Lloh27:
	ldr	w11, [x11]
	tst	w11, w0
	b.eq	LBB0_8
; %bb.7:
	orr	w9, w9, w10
	str	w9, [x19, #12]
LBB0_8:
Lloh28:
	adrp	x10, _PMSR_TX_FC@GOTPAGE
Lloh29:
	ldr	x10, [x10, _PMSR_TX_FC@GOTPAGEOFF]
Lloh30:
	ldr	w10, [x10]
	tst	w10, w0
	b.eq	LBB0_10
; %bb.9:
	orr	w8, w9, w8
	str	w8, [x19, #12]
LBB0_10:
	mov	w0, #1
LBB0_11:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_MT7530_NUM_PORTS,4,2           ; @MT7530_NUM_PORTS
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PMSR_LINK,4,2                  ; @PMSR_LINK
	.comm	_PMSR_DPX,4,2                   ; @PMSR_DPX
	.comm	_PMSR_SPEED_MASK,4,2            ; @PMSR_SPEED_MASK
	.comm	_SPEED_10,4,2                   ; @SPEED_10
	.comm	_SPEED_100,4,2                  ; @SPEED_100
	.comm	_SPEED_1000,4,2                 ; @SPEED_1000
	.comm	_SPEED_UNKNOWN,4,2              ; @SPEED_UNKNOWN
	.comm	_MLO_PAUSE_RX,4,2               ; @MLO_PAUSE_RX
	.comm	_MLO_PAUSE_TX,4,2               ; @MLO_PAUSE_TX
	.comm	_PMSR_RX_FC,4,2                 ; @PMSR_RX_FC
	.comm	_PMSR_TX_FC,4,2                 ; @PMSR_TX_FC
	.no_dead_strip	_mt7530_phylink_mac_link_state
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.mt7530_phylink_mac_link_state
l_switch.table.mt7530_phylink_mac_link_state:
	.quad	_SPEED_1000
	.quad	_SPEED_100
	.quad	_SPEED_10

.subsections_via_symbols
