	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_genphy_update_link             ## -- Begin function genphy_update_link
	.p2align	4, 0x90
_genphy_update_link:                    ## @genphy_update_link
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movq	_MII_BMCR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_phy_read
	testl	%eax, %eax
	js	LBB0_10
## %bb.1:
	movq	_BMCR_ANRESTART@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	movl	$0, %eax
	jne	LBB0_6
## %bb.2:
	movq	%rbx, %rdi
	callq	_phy_polling_mode
	testl	%eax, %eax
	je	LBB0_3
LBB0_5:
	movq	_MII_BMSR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_phy_read
	testl	%eax, %eax
	jns	LBB0_6
	jmp	LBB0_10
LBB0_3:
	movq	_MII_BMSR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_phy_read
	testl	%eax, %eax
	js	LBB0_10
## %bb.4:
	movq	_BMSR_LSTATUS@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_5
LBB0_6:
	movq	_BMSR_LSTATUS@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	movl	(%rcx), %ecx
	andl	%eax, %ecx
	setne	%dl
	movl	%edx, (%rbx)
	movq	_BMSR_ANEGCOMPLETE@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	andl	(%rcx), %eax
	setne	%dl
	movl	%edx, 4(%rbx)
	movq	8(%rbx), %rcx
	movq	_AUTONEG_ENABLE@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_9
## %bb.7:
	testl	%eax, %eax
	jne	LBB0_9
## %bb.8:
	movl	$0, (%rbx)
LBB0_9:
	xorl	%eax, %eax
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MII_BMCR,4,2                   ## @MII_BMCR
	.comm	_BMCR_ANRESTART,4,2             ## @BMCR_ANRESTART
	.comm	_MII_BMSR,4,2                   ## @MII_BMSR
	.comm	_BMSR_LSTATUS,4,2               ## @BMSR_LSTATUS
	.comm	_BMSR_ANEGCOMPLETE,4,2          ## @BMSR_ANEGCOMPLETE
	.comm	_AUTONEG_ENABLE,8,3             ## @AUTONEG_ENABLE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_genphy_update_link             ; -- Begin function genphy_update_link
	.p2align	2
_genphy_update_link:                    ; @genphy_update_link
	.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	x19, x0
Lloh0:
	adrp	x8, _MII_BMCR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MII_BMCR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_phy_read
	tbnz	w0, #31, LBB0_9
; %bb.1:
Lloh3:
	adrp	x8, _BMCR_ANRESTART@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BMCR_ANRESTART@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_3
; %bb.2:
	mov	w0, #0
	b	LBB0_7
LBB0_3:
	mov	x0, x19
	bl	_phy_polling_mode
Lloh6:
	adrp	x20, _MII_BMSR@GOTPAGE
Lloh7:
	ldr	x20, [x20, _MII_BMSR@GOTPAGEOFF]
	cbz	w0, LBB0_5
LBB0_4:
	ldr	w1, [x20]
	mov	x0, x19
	bl	_phy_read
	tbz	w0, #31, LBB0_7
	b	LBB0_9
LBB0_5:
	ldr	w1, [x20]
	mov	x0, x19
	bl	_phy_read
	tbnz	w0, #31, LBB0_9
; %bb.6:
Lloh8:
	adrp	x8, _BMSR_LSTATUS@GOTPAGE
Lloh9:
	ldr	x8, [x8, _BMSR_LSTATUS@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_4
LBB0_7:
Lloh11:
	adrp	x8, _BMSR_LSTATUS@GOTPAGE
Lloh12:
	ldr	x8, [x8, _BMSR_LSTATUS@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	tst	w8, w0
	cset	w8, ne
	str	w8, [x19]
Lloh14:
	adrp	x8, _BMSR_ANEGCOMPLETE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _BMSR_ANEGCOMPLETE@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	ands	w8, w8, w0
	cset	w9, ne
	str	w9, [x19, #4]
	ldr	x9, [x19, #8]
Lloh17:
	adrp	x10, _AUTONEG_ENABLE@GOTPAGE
Lloh18:
	ldr	x10, [x10, _AUTONEG_ENABLE@GOTPAGEOFF]
Lloh19:
	ldr	x10, [x10]
	cmp	x9, x10
	mov	w0, #0
	ccmp	w8, #0, #0, eq
	b.ne	LBB0_9
; %bb.8:
	str	wzr, [x19]
LBB0_9:
	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 AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_MII_BMCR,4,2                   ; @MII_BMCR
	.comm	_BMCR_ANRESTART,4,2             ; @BMCR_ANRESTART
	.comm	_MII_BMSR,4,2                   ; @MII_BMSR
	.comm	_BMSR_LSTATUS,4,2               ; @BMSR_LSTATUS
	.comm	_BMSR_ANEGCOMPLETE,4,2          ; @BMSR_ANEGCOMPLETE
	.comm	_AUTONEG_ENABLE,8,3             ; @AUTONEG_ENABLE
.subsections_via_symbols
