	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	__mt7620_mii_read               ## -- Begin function _mt7620_mii_read
	.p2align	4, 0x90
__mt7620_mii_read:                      ## @_mt7620_mii_read
	.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
	movl	%edx, %ebx
	movl	%esi, %r12d
	movq	%rdi, %r15
	callq	_mt7620_mii_busy_wait
	movl	$65535, %r14d                   ## imm = 0xFFFF
	testq	%rax, %rax
	jne	LBB0_3
## %bb.1:
	movq	_GSW_MDIO_ACCESS@GOTPCREL(%rip), %rax
	movq	_GSW_MDIO_START@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	_GSW_MDIO_READ@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	_GSW_MDIO_REG_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %ebx
	movq	_GSW_MDIO_ADDR_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %r12d
	orl	%edx, %ebx
	orl	%ebx, %r12d
	movq	_MT7620A_GSW_REG_PIAC@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	movq	%r15, %rdi
	movl	%r12d, %esi
	callq	_mtk_switch_w32
	movq	%r15, %rdi
	callq	_mt7620_mii_busy_wait
	testq	%rax, %rax
	jne	LBB0_3
## %bb.2:
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_mtk_switch_r32
	movzwl	%ax, %r14d
LBB0_3:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GSW_MDIO_ACCESS,4,2            ## @GSW_MDIO_ACCESS
	.comm	_GSW_MDIO_START,4,2             ## @GSW_MDIO_START
	.comm	_GSW_MDIO_READ,4,2              ## @GSW_MDIO_READ
	.comm	_GSW_MDIO_REG_SHIFT,4,2         ## @GSW_MDIO_REG_SHIFT
	.comm	_GSW_MDIO_ADDR_SHIFT,4,2        ## @GSW_MDIO_ADDR_SHIFT
	.comm	_MT7620A_GSW_REG_PIAC,4,2       ## @MT7620A_GSW_REG_PIAC
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	__mt7620_mii_read               ; -- Begin function _mt7620_mii_read
	.p2align	2
__mt7620_mii_read:                      ; @_mt7620_mii_read
	.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	x21, x2
	mov	x20, x1
	mov	x19, x0
	bl	_mt7620_mii_busy_wait
	cbnz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _GSW_MDIO_ACCESS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GSW_MDIO_ACCESS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _GSW_MDIO_START@GOTPAGE
Lloh4:
	ldr	x9, [x9, _GSW_MDIO_START@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh6:
	adrp	x9, _GSW_MDIO_READ@GOTPAGE
Lloh7:
	ldr	x9, [x9, _GSW_MDIO_READ@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
Lloh9:
	adrp	x10, _GSW_MDIO_REG_SHIFT@GOTPAGE
Lloh10:
	ldr	x10, [x10, _GSW_MDIO_REG_SHIFT@GOTPAGEOFF]
	orr	w8, w8, w9
Lloh11:
	ldr	w9, [x10]
	lsl	w9, w21, w9
	orr	w8, w8, w9
Lloh12:
	adrp	x9, _GSW_MDIO_ADDR_SHIFT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _GSW_MDIO_ADDR_SHIFT@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	lsl	w9, w20, w9
	orr	w1, w8, w9
Lloh15:
	adrp	x20, _MT7620A_GSW_REG_PIAC@GOTPAGE
Lloh16:
	ldr	x20, [x20, _MT7620A_GSW_REG_PIAC@GOTPAGEOFF]
	ldr	w2, [x20]
	mov	x0, x19
	bl	_mtk_switch_w32
	mov	x0, x19
	bl	_mt7620_mii_busy_wait
	cbz	x0, LBB0_4
LBB0_2:
	mov	w0, #65535
LBB0_3:
	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
LBB0_4:
	ldr	w1, [x20]
	mov	x0, x19
	bl	_mtk_switch_r32
	and	w0, w0, #0xffff
	b	LBB0_3
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_GSW_MDIO_ACCESS,4,2            ; @GSW_MDIO_ACCESS
	.comm	_GSW_MDIO_START,4,2             ; @GSW_MDIO_START
	.comm	_GSW_MDIO_READ,4,2              ; @GSW_MDIO_READ
	.comm	_GSW_MDIO_REG_SHIFT,4,2         ; @GSW_MDIO_REG_SHIFT
	.comm	_GSW_MDIO_ADDR_SHIFT,4,2        ; @GSW_MDIO_ADDR_SHIFT
	.comm	_MT7620A_GSW_REG_PIAC,4,2       ; @MT7620A_GSW_REG_PIAC
.subsections_via_symbols
