	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ar8xxx_phy_check_aneg
_ar8xxx_phy_check_aneg:                 ## @ar8xxx_phy_check_aneg
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rax
	movq	_AUTONEG_ENABLE@GOTPCREL(%rip), %rcx
	xorl	%r14d, %r14d
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.1:
	movq	%rdi, %rbx
	movq	_MII_BMCR@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	callq	_phy_read
	movl	%eax, %r15d
	testl	%eax, %eax
	js	LBB0_2
## %bb.3:
	movq	_BMCR_ANENABLE@GOTPCREL(%rip), %r13
	testl	%r15d, (%r13)
	jne	LBB0_4
## %bb.5:
	leaq	8(%rbx), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_info
	movq	_BMCR_ANRESTART@GOTPCREL(%rip), %rax
	movl	(%r13), %edx
	orl	%r15d, %edx
	orl	(%rax), %edx
	movl	(%r12), %esi
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_phy_write                      ## TAILCALL
LBB0_2:
	movl	%r15d, %r14d
LBB0_4:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AUTONEG_ENABLE,8,3             ## @AUTONEG_ENABLE
	.comm	_MII_BMCR,4,2                   ## @MII_BMCR
	.comm	_BMCR_ANENABLE,4,2              ## @BMCR_ANENABLE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ANEG disabled, re-enabling ...\n"

	.comm	_BMCR_ANRESTART,4,2             ## @BMCR_ANRESTART
	.no_dead_strip	_ar8xxx_phy_check_aneg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ar8xxx_phy_check_aneg
_ar8xxx_phy_check_aneg:                 ; @ar8xxx_phy_check_aneg
	.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
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _AUTONEG_ENABLE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AUTONEG_ENABLE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.1:
	mov	x19, x0
Lloh3:
	adrp	x21, _MII_BMCR@GOTPAGE
Lloh4:
	ldr	x21, [x21, _MII_BMCR@GOTPAGEOFF]
	ldr	w1, [x21]
	bl	_phy_read
	mov	x20, x0
	tbnz	w0, #31, LBB0_4
; %bb.2:
Lloh5:
	adrp	x22, _BMCR_ANENABLE@GOTPAGE
Lloh6:
	ldr	x22, [x22, _BMCR_ANENABLE@GOTPAGEOFF]
	ldr	w8, [x22]
	tst	w8, w20
	b.eq	LBB0_5
LBB0_3:
	mov	w20, #0
LBB0_4:
	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
LBB0_5:
	add	x0, x19, #8
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_info
	ldr	w8, [x22]
Lloh9:
	adrp	x9, _BMCR_ANRESTART@GOTPAGE
Lloh10:
	ldr	x9, [x9, _BMCR_ANRESTART@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w8, w8, w20
	orr	w2, w8, w9
	ldr	w1, [x21]
	mov	x0, x19
	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
	b	_phy_write
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_AUTONEG_ENABLE,8,3             ; @AUTONEG_ENABLE
	.comm	_MII_BMCR,4,2                   ; @MII_BMCR
	.comm	_BMCR_ANENABLE,4,2              ; @BMCR_ANENABLE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ANEG disabled, re-enabling ...\n"

	.comm	_BMCR_ANRESTART,4,2             ; @BMCR_ANRESTART
	.no_dead_strip	_ar8xxx_phy_check_aneg
.subsections_via_symbols
