	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cavium_mdiobus_read            ## -- Begin function cavium_mdiobus_read
	.p2align	4, 0x90
_cavium_mdiobus_read:                   ## @cavium_mdiobus_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%esi, %ebx
	movq	(%rdi), %r14
	movq	_MII_ADDR_C45@GOTPCREL(%rip), %rax
	testl	%edx, (%rax)
	je	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_cavium_mdiobus_c45_addr
	movl	$3, %ecx
	testl	%eax, %eax
	jns	LBB0_3
	jmp	LBB0_4
LBB0_2:
	movq	_C22@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_cavium_mdiobus_set_mode
	movl	$1, %ecx
LBB0_3:
	shlq	$32, %rbx
	orq	%rcx, %rbx
	movq	_SMI_CMD@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r14), %rsi
	movq	%rbx, %rdi
	callq	_oct_mdio_writeq
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	___delay
	movq	_SMI_RD_DAT@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r14), %rdi
	callq	_oct_mdio_readq
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_4:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MII_ADDR_C45,4,2               ## @MII_ADDR_C45
	.comm	_C22,4,2                        ## @C22
	.comm	_SMI_CMD,8,3                    ## @SMI_CMD
	.comm	_SMI_RD_DAT,8,3                 ## @SMI_RD_DAT
	.comm	_EIO,4,2                        ## @EIO
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cavium_mdiobus_read            ; -- Begin function cavium_mdiobus_read
	.p2align	2
_cavium_mdiobus_read:                   ; @cavium_mdiobus_read
	.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
	mov	x20, x1
	ldr	x19, [x0]
Lloh0:
	adrp	x8, _MII_ADDR_C45@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MII_ADDR_C45@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w2
	b.eq	LBB0_3
; %bb.1:
	mov	x0, x19
	mov	x1, x20
	bl	_cavium_mdiobus_c45_addr
	tbnz	w0, #31, LBB0_5
; %bb.2:
	mov	w0, #3
	b	LBB0_4
LBB0_3:
Lloh3:
	adrp	x8, _C22@GOTPAGE
Lloh4:
	ldr	x8, [x8, _C22@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_cavium_mdiobus_set_mode
	mov	w0, #1
LBB0_4:
	bfi	x0, x20, #32, #32
	ldr	x8, [x19]
Lloh6:
	adrp	x9, _SMI_CMD@GOTPAGE
Lloh7:
	ldr	x9, [x9, _SMI_CMD@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_oct_mdio_writeq
	mov	w0, #1000
	bl	___delay
	ldr	x8, [x19]
Lloh9:
	adrp	x9, _SMI_RD_DAT@GOTPAGE
Lloh10:
	ldr	x9, [x9, _SMI_RD_DAT@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_oct_mdio_readq
Lloh12:
	adrp	x8, _EIO@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_MII_ADDR_C45,4,2               ; @MII_ADDR_C45
	.comm	_C22,4,2                        ; @C22
	.comm	_SMI_CMD,8,3                    ; @SMI_CMD
	.comm	_SMI_RD_DAT,8,3                 ; @SMI_RD_DAT
	.comm	_EIO,4,2                        ; @EIO
.subsections_via_symbols
