	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ethoc_mdio_probe
_ethoc_mdio_probe:                      ## @ethoc_mdio_probe
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_netdev_priv
	movq	%rax, %rbx
	movl	(%rax), %esi
	movl	12(%rax), %edi
	cmpl	$-1, %esi
	je	LBB0_2
## %bb.1:
	callq	_mdiobus_get_phy
	jmp	LBB0_3
LBB0_2:
	callq	_phy_find_first
LBB0_3:
	movq	%rax, %r15
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	$-1, 4(%rbx)
	movq	_ethoc_mdio_poll@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_PHY_INTERFACE_MODE_GMII@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_phy_connect_direct
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	jmp	LBB0_8
LBB0_4:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	movq	_ENXIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_8
LBB0_7:
	movq	_SPEED_100@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_phy_set_max_speed
	xorl	%ebx, %ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no PHY found\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_ethoc_mdio_poll,4,2            ## @ethoc_mdio_poll
	.comm	_PHY_INTERFACE_MODE_GMII,4,2    ## @PHY_INTERFACE_MODE_GMII
L_.str.1:                               ## @.str.1
	.asciz	"could not attach to PHY\n"

	.comm	_SPEED_100,4,2                  ## @SPEED_100
	.no_dead_strip	_ethoc_mdio_probe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ethoc_mdio_probe
_ethoc_mdio_probe:                      ; @ethoc_mdio_probe
	.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, x0
	bl	_netdev_priv
	mov	x20, x0
	ldr	w1, [x0]
	ldr	w0, [x0, #12]
	cmn	w1, #1
	b.eq	LBB0_4
; %bb.1:
	bl	_mdiobus_get_phy
	mov	x21, x0
	cbz	x0, LBB0_5
LBB0_2:
	movi.2d	v0, #0xffffffffffffffff
	stur	d0, [x20, #4]
Lloh0:
	adrp	x8, _ethoc_mdio_poll@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ethoc_mdio_poll@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
Lloh3:
	adrp	x8, _PHY_INTERFACE_MODE_GMII@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PHY_INTERFACE_MODE_GMII@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
	mov	x0, x19
	mov	x1, x21
	bl	_phy_connect_direct
	mov	x20, x0
	cbz	w0, LBB0_6
; %bb.3:
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	b	LBB0_7
LBB0_4:
	bl	_phy_find_first
	mov	x21, x0
	cbnz	x0, LBB0_2
LBB0_5:
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
Lloh10:
	adrp	x8, _ENXIO@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_7
LBB0_6:
Lloh13:
	adrp	x8, _SPEED_100@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SPEED_100@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_phy_set_max_speed
LBB0_7:
	mov	x0, x20
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no PHY found\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_ethoc_mdio_poll,4,2            ; @ethoc_mdio_poll
	.comm	_PHY_INTERFACE_MODE_GMII,4,2    ; @PHY_INTERFACE_MODE_GMII
l_.str.1:                               ; @.str.1
	.asciz	"could not attach to PHY\n"

	.comm	_SPEED_100,4,2                  ; @SPEED_100
	.no_dead_strip	_ethoc_mdio_probe
.subsections_via_symbols
