	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function greth_mdio_probe
_greth_mdio_probe:                      ## @greth_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_netdev_priv
	movq	%rax, %r15
	movl	32(%rax), %edi
	callq	_phy_find_first
	testq	%rax, %rax
	je	LBB0_1
## %bb.4:
	movq	%rax, %r12
	cmpq	$0, 24(%r15)
	jne	LBB0_5
## %bb.6:
	movq	_PHY_INTERFACE_MODE_MII@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_1:
	movq	%r15, %rdi
	callq	_netif_msg_probe
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
LBB0_3:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_14
LBB0_5:
	movq	_PHY_INTERFACE_MODE_GMII@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %ecx
	movq	_greth_link_change@GOTPCREL(%rip), %rdx
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_phy_connect_direct
	testl	%eax, %eax
	je	LBB0_10
## %bb.8:
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_netif_msg_ifup
	testq	%rax, %rax
	je	LBB0_14
## %bb.9:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	jmp	LBB0_14
LBB0_10:
	cmpq	$0, 24(%r15)
	jne	LBB0_11
## %bb.12:
	movq	_SPEED_100@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_11:
	movq	_SPEED_1000@GOTPCREL(%rip), %rax
LBB0_13:
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_phy_set_max_speed
	movl	(%r12), %esi
	movl	4(%r12), %edi
	callq	_linkmode_copy
	xorps	%xmm0, %xmm0
	movups	%xmm0, 8(%r15)
	movl	$-1, (%r15)
	xorl	%ebx, %ebx
LBB0_14:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	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	_greth_link_change,4,2          ## @greth_link_change
	.comm	_PHY_INTERFACE_MODE_GMII,4,2    ## @PHY_INTERFACE_MODE_GMII
	.comm	_PHY_INTERFACE_MODE_MII,4,2     ## @PHY_INTERFACE_MODE_MII
L_.str.1:                               ## @.str.1
	.asciz	"could not attach to PHY\n"

	.comm	_SPEED_1000,4,2                 ## @SPEED_1000
	.comm	_SPEED_100,4,2                  ## @SPEED_100
	.no_dead_strip	_greth_mdio_probe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function greth_mdio_probe
_greth_mdio_probe:                      ; @greth_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	x20, x0
	bl	_netdev_priv
	mov	x19, x0
	ldr	w0, [x0, #32]
	bl	_phy_find_first
	cbz	x0, LBB0_4
; %bb.1:
	mov	x22, x0
Lloh0:
	adrp	x8, _PHY_INTERFACE_MODE_GMII@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PHY_INTERFACE_MODE_GMII@GOTPAGEOFF]
	ldr	x9, [x19, #24]
Lloh2:
	adrp	x10, _PHY_INTERFACE_MODE_MII@GOTPAGE
Lloh3:
	ldr	x10, [x10, _PHY_INTERFACE_MODE_MII@GOTPAGEOFF]
	cmp	x9, #0
	csel	x8, x10, x8, eq
	ldr	w3, [x8]
Lloh4:
	adrp	x2, _greth_link_change@GOTPAGE
Lloh5:
	ldr	x2, [x2, _greth_link_change@GOTPAGEOFF]
	mov	x0, x20
	mov	x1, x22
	bl	_phy_connect_direct
	mov	x21, x0
	cbz	w0, LBB0_7
; %bb.2:
	mov	x0, x19
	bl	_netif_msg_ifup
	cbz	x0, LBB0_8
; %bb.3:
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_dev_err
	b	LBB0_8
LBB0_4:
	mov	x0, x19
	bl	_netif_msg_probe
	cbz	x0, LBB0_6
; %bb.5:
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_err
LBB0_6:
Lloh10:
	adrp	x8, _ENXIO@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_8
LBB0_7:
Lloh13:
	adrp	x8, _SPEED_100@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SPEED_100@GOTPAGEOFF]
	ldr	x9, [x19, #24]
Lloh15:
	adrp	x10, _SPEED_1000@GOTPAGE
Lloh16:
	ldr	x10, [x10, _SPEED_1000@GOTPAGEOFF]
	cmp	x9, #0
	csel	x8, x8, x10, eq
	ldr	w1, [x8]
	mov	x0, x22
	bl	_phy_set_max_speed
	ldp	w1, w0, [x22]
	bl	_linkmode_copy
	stp	xzr, xzr, [x19, #8]
	mov	w8, #-1
	str	w8, [x19]
LBB0_8:
	mov	x0, x21
	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	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no PHY found\n"

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

	.comm	_SPEED_1000,4,2                 ; @SPEED_1000
	.comm	_SPEED_100,4,2                  ; @SPEED_100
	.no_dead_strip	_greth_mdio_probe
.subsections_via_symbols
