	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mscc_miim_read
_mscc_miim_read:                        ## @mscc_miim_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, %r15d
	movq	%rdi, %r14
	movq	(%rdi), %r12
	callq	_mscc_miim_wait_ready
	testl	%eax, %eax
	jne	LBB0_5
## %bb.1:
	movq	_MSCC_MIIM_CMD_PHYAD_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %r15d
	movq	_MSCC_MIIM_CMD_VLD@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
	movq	_MSCC_MIIM_CMD_REGAD_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %ebx
	orl	%r15d, %ebx
	movq	_MSCC_MIIM_CMD_OPR_READ@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	_MSCC_MIIM_REG_CMD@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r12), %rsi
	movl	%ebx, %edi
	callq	_writel
	movq	%r14, %rdi
	callq	_mscc_miim_wait_ready
	testl	%eax, %eax
	jne	LBB0_5
## %bb.2:
	movq	_MSCC_MIIM_REG_DATA@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r12), %rdi
	callq	_readl
	movq	_MSCC_MIIM_DATA_ERROR@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_4
## %bb.3:
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_5
LBB0_4:
	movzwl	%ax, %eax
LBB0_5:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MSCC_MIIM_CMD_VLD,4,2          ## @MSCC_MIIM_CMD_VLD
	.comm	_MSCC_MIIM_CMD_PHYAD_SHIFT,4,2  ## @MSCC_MIIM_CMD_PHYAD_SHIFT
	.comm	_MSCC_MIIM_CMD_REGAD_SHIFT,4,2  ## @MSCC_MIIM_CMD_REGAD_SHIFT
	.comm	_MSCC_MIIM_CMD_OPR_READ,4,2     ## @MSCC_MIIM_CMD_OPR_READ
	.comm	_MSCC_MIIM_REG_CMD,8,3          ## @MSCC_MIIM_REG_CMD
	.comm	_MSCC_MIIM_REG_DATA,8,3         ## @MSCC_MIIM_REG_DATA
	.comm	_MSCC_MIIM_DATA_ERROR,4,2       ## @MSCC_MIIM_DATA_ERROR
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_mscc_miim_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mscc_miim_read
_mscc_miim_read:                        ; @mscc_miim_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	x20, x2
	mov	x21, x1
	mov	x19, x0
	ldr	x22, [x0]
	bl	_mscc_miim_wait_ready
	cbnz	w0, LBB0_5
; %bb.1:
Lloh0:
	adrp	x8, _MSCC_MIIM_CMD_VLD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MSCC_MIIM_CMD_VLD@GOTPAGEOFF]
Lloh2:
	adrp	x9, _MSCC_MIIM_CMD_PHYAD_SHIFT@GOTPAGE
Lloh3:
	ldr	x9, [x9, _MSCC_MIIM_CMD_PHYAD_SHIFT@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	ldr	w9, [x9]
	lsl	w9, w21, w9
	orr	w8, w9, w8
Lloh6:
	adrp	x9, _MSCC_MIIM_CMD_REGAD_SHIFT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _MSCC_MIIM_CMD_REGAD_SHIFT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	lsl	w9, w20, w9
	orr	w8, w8, w9
Lloh9:
	adrp	x9, _MSCC_MIIM_CMD_OPR_READ@GOTPAGE
Lloh10:
	ldr	x9, [x9, _MSCC_MIIM_CMD_OPR_READ@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w0, w8, w9
	ldr	x8, [x22]
Lloh12:
	adrp	x9, _MSCC_MIIM_REG_CMD@GOTPAGE
Lloh13:
	ldr	x9, [x9, _MSCC_MIIM_REG_CMD@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	mov	x0, x19
	bl	_mscc_miim_wait_ready
	cbnz	w0, LBB0_5
; %bb.2:
	ldr	x8, [x22]
Lloh15:
	adrp	x9, _MSCC_MIIM_REG_DATA@GOTPAGE
Lloh16:
	ldr	x9, [x9, _MSCC_MIIM_REG_DATA@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl
Lloh18:
	adrp	x8, _MSCC_MIIM_DATA_ERROR@GOTPAGE
Lloh19:
	ldr	x8, [x8, _MSCC_MIIM_DATA_ERROR@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_4
; %bb.3:
Lloh21:
	adrp	x8, _EIO@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_5
LBB0_4:
	and	w0, w0, #0xffff
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	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_MSCC_MIIM_CMD_VLD,4,2          ; @MSCC_MIIM_CMD_VLD
	.comm	_MSCC_MIIM_CMD_PHYAD_SHIFT,4,2  ; @MSCC_MIIM_CMD_PHYAD_SHIFT
	.comm	_MSCC_MIIM_CMD_REGAD_SHIFT,4,2  ; @MSCC_MIIM_CMD_REGAD_SHIFT
	.comm	_MSCC_MIIM_CMD_OPR_READ,4,2     ; @MSCC_MIIM_CMD_OPR_READ
	.comm	_MSCC_MIIM_REG_CMD,8,3          ; @MSCC_MIIM_REG_CMD
	.comm	_MSCC_MIIM_REG_DATA,8,3         ; @MSCC_MIIM_REG_DATA
	.comm	_MSCC_MIIM_DATA_ERROR,4,2       ; @MSCC_MIIM_DATA_ERROR
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_mscc_miim_read
.subsections_via_symbols
