	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function orion_mdio_xsmi_read
_orion_mdio_xsmi_read:                  ## @orion_mdio_xsmi_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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r12d
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	8(%rdi), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	movl	$4, %edi
	xorl	%esi, %esi
	callq	_GENMASK
	movl	%eax, %r13d
	movq	_MII_ADDR_C45@GOTPCREL(%rip), %rax
	testl	%r12d, (%rax)
	je	LBB0_5
## %bb.1:
	movq	_orion_mdio_xsmi_ops@GOTPCREL(%rip), %rdi
	movq	%r15, %rsi
	callq	_orion_mdio_wait_ready
	testl	%eax, %eax
	js	LBB0_7
## %bb.2:
	movl	%r12d, %eax
	sarl	$16, %eax
	andl	%eax, %r13d
	movl	$15, %edi
	xorl	%esi, %esi
	callq	_GENMASK
	andl	%eax, %r12d
	movq	_MVMDIO_XSMI_ADDR_REG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	addq	(%rax), %rsi
	movl	%r12d, %edi
	movq	%rax, %r12
	callq	_writel
	movq	_MVMDIO_XSMI_PHYADDR_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %r14d
	movq	_MVMDIO_XSMI_DEVADDR_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %r13d
	orl	%r14d, %r13d
	movq	_MVMDIO_XSMI_READ_OPERATION@GOTPCREL(%rip), %rax
	orl	(%rax), %r13d
	movq	_MVMDIO_XSMI_MGNT_REG@GOTPCREL(%rip), %r14
	movq	(%r14), %rsi
	addq	(%r12), %rsi
	movl	%r13d, %edi
	callq	_writel
	movq	_orion_mdio_xsmi_ops@GOTPCREL(%rip), %rdi
	movq	%r15, %rsi
	callq	_orion_mdio_wait_ready
	testl	%eax, %eax
	js	LBB0_7
## %bb.3:
	movq	(%r14), %rdi
	addq	(%r12), %rdi
	callq	_readl
	movq	_MVMDIO_XSMI_READ_VALID@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_8
## %bb.4:
	movq	(%r14), %rdi
	addq	(%r12), %rdi
	callq	_readl
	movl	%eax, %r14d
	movl	$15, %edi
	xorl	%esi, %esi
	callq	_GENMASK
	movl	%eax, %ebx
	andl	%r14d, %ebx
	jmp	LBB0_10
LBB0_5:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_7:
	movl	%eax, %ebx
	jmp	LBB0_10
LBB0_8:
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
LBB0_9:
	subl	(%rax), %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MII_ADDR_C45,4,2               ## @MII_ADDR_C45
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_orion_mdio_xsmi_ops,4,2        ## @orion_mdio_xsmi_ops
	.comm	_MVMDIO_XSMI_ADDR_REG,8,3       ## @MVMDIO_XSMI_ADDR_REG
	.comm	_MVMDIO_XSMI_PHYADDR_SHIFT,4,2  ## @MVMDIO_XSMI_PHYADDR_SHIFT
	.comm	_MVMDIO_XSMI_DEVADDR_SHIFT,4,2  ## @MVMDIO_XSMI_DEVADDR_SHIFT
	.comm	_MVMDIO_XSMI_READ_OPERATION,4,2 ## @MVMDIO_XSMI_READ_OPERATION
	.comm	_MVMDIO_XSMI_MGNT_REG,8,3       ## @MVMDIO_XSMI_MGNT_REG
	.comm	_MVMDIO_XSMI_READ_VALID,4,2     ## @MVMDIO_XSMI_READ_VALID
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"XSMI bus read not valid\n"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function orion_mdio_xsmi_read
_orion_mdio_xsmi_read:                  ; @orion_mdio_xsmi_read
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
	ldr	x23, [x0, #8]
	mov	w0, #4
	mov	w1, #0
	bl	_GENMASK
Lloh0:
	adrp	x8, _MII_ADDR_C45@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MII_ADDR_C45@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_5
; %bb.1:
	mov	x22, x0
Lloh3:
	adrp	x0, _orion_mdio_xsmi_ops@GOTPAGE
Lloh4:
	ldr	x0, [x0, _orion_mdio_xsmi_ops@GOTPAGEOFF]
	mov	x1, x19
	bl	_orion_mdio_wait_ready
	tbnz	w0, #31, LBB0_8
; %bb.2:
	and	w22, w22, w21, asr #16
	mov	w0, #15
	mov	w1, #0
	bl	_GENMASK
	and	w0, w0, w21
	ldr	x8, [x23]
Lloh5:
	adrp	x9, _MVMDIO_XSMI_ADDR_REG@GOTPAGE
Lloh6:
	ldr	x9, [x9, _MVMDIO_XSMI_ADDR_REG@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
Lloh8:
	adrp	x8, _MVMDIO_XSMI_PHYADDR_SHIFT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MVMDIO_XSMI_PHYADDR_SHIFT@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	lsl	w8, w20, w8
Lloh11:
	adrp	x9, _MVMDIO_XSMI_DEVADDR_SHIFT@GOTPAGE
Lloh12:
	ldr	x9, [x9, _MVMDIO_XSMI_DEVADDR_SHIFT@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	lsl	w9, w22, w9
	orr	w8, w9, w8
Lloh14:
	adrp	x9, _MVMDIO_XSMI_READ_OPERATION@GOTPAGE
Lloh15:
	ldr	x9, [x9, _MVMDIO_XSMI_READ_OPERATION@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	orr	w0, w8, w9
	ldr	x8, [x23]
Lloh17:
	adrp	x20, _MVMDIO_XSMI_MGNT_REG@GOTPAGE
Lloh18:
	ldr	x20, [x20, _MVMDIO_XSMI_MGNT_REG@GOTPAGEOFF]
	ldr	x9, [x20]
	add	x1, x9, x8
	bl	_writel
Lloh19:
	adrp	x0, _orion_mdio_xsmi_ops@GOTPAGE
Lloh20:
	ldr	x0, [x0, _orion_mdio_xsmi_ops@GOTPAGEOFF]
	mov	x1, x19
	bl	_orion_mdio_wait_ready
	tbnz	w0, #31, LBB0_8
; %bb.3:
	ldr	x8, [x23]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_readl
Lloh21:
	adrp	x8, _MVMDIO_XSMI_READ_VALID@GOTPAGE
Lloh22:
	ldr	x8, [x8, _MVMDIO_XSMI_READ_VALID@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_6
; %bb.4:
	ldr	x8, [x23]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_readl
	mov	x19, x0
	mov	w0, #15
	mov	w1, #0
	bl	_GENMASK
	and	w0, w0, w19
	b	LBB0_8
LBB0_5:
Lloh24:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
	ldr	w0, [x19]
Lloh26:
	adrp	x1, l_.str@PAGE
Lloh27:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh28:
	adrp	x8, _ENODEV@GOTPAGE
Lloh29:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_MII_ADDR_C45,4,2               ; @MII_ADDR_C45
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_orion_mdio_xsmi_ops,4,2        ; @orion_mdio_xsmi_ops
	.comm	_MVMDIO_XSMI_ADDR_REG,8,3       ; @MVMDIO_XSMI_ADDR_REG
	.comm	_MVMDIO_XSMI_PHYADDR_SHIFT,4,2  ; @MVMDIO_XSMI_PHYADDR_SHIFT
	.comm	_MVMDIO_XSMI_DEVADDR_SHIFT,4,2  ; @MVMDIO_XSMI_DEVADDR_SHIFT
	.comm	_MVMDIO_XSMI_READ_OPERATION,4,2 ; @MVMDIO_XSMI_READ_OPERATION
	.comm	_MVMDIO_XSMI_MGNT_REG,8,3       ; @MVMDIO_XSMI_MGNT_REG
	.comm	_MVMDIO_XSMI_READ_VALID,4,2     ; @MVMDIO_XSMI_READ_VALID
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"XSMI bus read not valid\n"

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