	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function unimac_mdio_read
_unimac_mdio_read:                      ## @unimac_mdio_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	%esi, %r14d
	movq	%rdi, %r15
	movq	_MDIO_PMD_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %esi
	movq	_MDIO_RD@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	_MDIO_REG_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %edx
	movq	8(%rdi), %rbx
	orl	%edx, %esi
	movq	_MDIO_CMD@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movq	%rbx, %rdi
	callq	_unimac_mdio_writel
	movq	%rbx, %rdi
	callq	_unimac_mdio_start
	movl	8(%rbx), %edi
	callq	*(%rbx)
	testl	%eax, %eax
	jne	LBB0_5
## %bb.1:
	movl	(%r12), %esi
	movq	%rbx, %rdi
	callq	_unimac_mdio_readl
	movl	(%r15), %ecx
	btl	%r14d, %ecx
	jae	LBB0_2
LBB0_4:
	movzwl	%ax, %eax
	jmp	LBB0_5
LBB0_2:
	movq	_MDIO_READ_FAIL@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_4
## %bb.3:
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_5:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MDIO_RD,4,2                    ## @MDIO_RD
	.comm	_MDIO_PMD_SHIFT,4,2             ## @MDIO_PMD_SHIFT
	.comm	_MDIO_REG_SHIFT,4,2             ## @MDIO_REG_SHIFT
	.comm	_MDIO_CMD,4,2                   ## @MDIO_CMD
	.comm	_MDIO_READ_FAIL,4,2             ## @MDIO_READ_FAIL
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_unimac_mdio_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function unimac_mdio_read
_unimac_mdio_read:                      ; @unimac_mdio_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	x19, x1
	mov	x20, x0
	ldr	x21, [x0, #8]
Lloh0:
	adrp	x8, _MDIO_RD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MDIO_RD@GOTPAGEOFF]
Lloh2:
	adrp	x9, _MDIO_PMD_SHIFT@GOTPAGE
Lloh3:
	ldr	x9, [x9, _MDIO_PMD_SHIFT@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	ldr	w9, [x9]
	lsl	w9, w1, w9
	orr	w8, w9, w8
Lloh6:
	adrp	x9, _MDIO_REG_SHIFT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _MDIO_REG_SHIFT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	lsl	w9, w2, w9
	orr	w1, w8, w9
Lloh9:
	adrp	x22, _MDIO_CMD@GOTPAGE
Lloh10:
	ldr	x22, [x22, _MDIO_CMD@GOTPAGEOFF]
	ldr	w2, [x22]
	mov	x0, x21
	bl	_unimac_mdio_writel
	mov	x0, x21
	bl	_unimac_mdio_start
	ldr	x8, [x21]
	ldr	w0, [x21, #8]
	blr	x8
	cbnz	w0, LBB0_5
; %bb.1:
	ldr	w1, [x22]
	mov	x0, x21
	bl	_unimac_mdio_readl
	ldr	w8, [x20]
	lsr	w8, w8, w19
	tbz	w8, #0, LBB0_3
LBB0_2:
	and	w0, w0, #0xffff
	b	LBB0_5
LBB0_3:
Lloh11:
	adrp	x8, _MDIO_READ_FAIL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MDIO_READ_FAIL@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_2
; %bb.4:
Lloh14:
	adrp	x8, _EIO@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w0, w8
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 AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_MDIO_RD,4,2                    ; @MDIO_RD
	.comm	_MDIO_PMD_SHIFT,4,2             ; @MDIO_PMD_SHIFT
	.comm	_MDIO_REG_SHIFT,4,2             ; @MDIO_REG_SHIFT
	.comm	_MDIO_CMD,4,2                   ; @MDIO_CMD
	.comm	_MDIO_READ_FAIL,4,2             ; @MDIO_READ_FAIL
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_unimac_mdio_read
.subsections_via_symbols
