	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function e1000_copper_link_autoneg
_e1000_copper_link_autoneg:             ## @e1000_copper_link_autoneg
	.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
	movq	_AUTONEG_ADVERTISE_SPEED_DEFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	24(%rdi), %eax
	andl	%ecx, %eax
	cmovel	%ecx, %eax
	movl	%eax, 24(%rdi)
	movq	(%rdi), %rcx
	movq	_e1000_phy_8201@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_2
## %bb.1:
	movq	_AUTONEG_ADVERTISE_10_100_ALL@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movl	%eax, 24(%r14)
LBB0_2:
	leaq	L_.str(%rip), %rdi
	callq	_e_dbg
	movq	%r14, %rdi
	callq	_e1000_phy_setup_autoneg
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	%rax, %rbx
	leaq	L_.str.1(%rip), %rdi
	callq	_e_dbg
	jmp	LBB0_10
LBB0_4:
	leaq	L_.str.2(%rip), %rdi
	callq	_e_dbg
	movq	_PHY_CTRL@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	leaq	-28(%rbp), %rdx
	movq	%r14, %rdi
	callq	_e1000_read_phy_reg
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_10
## %bb.5:
	movq	_MII_CR_AUTO_NEG_EN@GOTPCREL(%rip), %rax
	movq	_MII_CR_RESTART_AUTO_NEG@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	orl	-28(%rbp), %edx
	movl	%edx, -28(%rbp)
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_e1000_write_phy_reg
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_10
## %bb.6:
	cmpq	$0, 16(%r14)
	je	LBB0_9
## %bb.7:
	movq	%r14, %rdi
	callq	_e1000_wait_autoneg
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	%rax, %rbx
	leaq	L_.str.3(%rip), %rdi
	callq	_e_dbg
	jmp	LBB0_10
LBB0_9:
	movl	$1, 8(%r14)
	movq	_E1000_SUCCESS@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
LBB0_10:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AUTONEG_ADVERTISE_SPEED_DEFAULT,4,2 ## @AUTONEG_ADVERTISE_SPEED_DEFAULT
	.comm	_e1000_phy_8201,8,3             ## @e1000_phy_8201
	.comm	_AUTONEG_ADVERTISE_10_100_ALL,4,2 ## @AUTONEG_ADVERTISE_10_100_ALL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Reconfiguring auto-neg advertisement params\n"

L_.str.1:                               ## @.str.1
	.asciz	"Error Setting up Auto-Negotiation\n"

L_.str.2:                               ## @.str.2
	.asciz	"Restarting Auto-Neg\n"

	.comm	_PHY_CTRL,4,2                   ## @PHY_CTRL
	.comm	_MII_CR_AUTO_NEG_EN,4,2         ## @MII_CR_AUTO_NEG_EN
	.comm	_MII_CR_RESTART_AUTO_NEG,4,2    ## @MII_CR_RESTART_AUTO_NEG
L_.str.3:                               ## @.str.3
	.asciz	"Error while waiting for autoneg to complete\n"

	.comm	_E1000_SUCCESS,8,3              ## @E1000_SUCCESS
	.no_dead_strip	_e1000_copper_link_autoneg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function e1000_copper_link_autoneg
_e1000_copper_link_autoneg:             ; @e1000_copper_link_autoneg
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
Lloh0:
	adrp	x8, _AUTONEG_ADVERTISE_SPEED_DEFAULT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AUTONEG_ADVERTISE_SPEED_DEFAULT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [x0, #24]
	ands	w9, w9, w8
	csel	w8, w8, w9, eq
	str	w8, [x0, #24]
	ldr	x9, [x0]
Lloh3:
	adrp	x10, _e1000_phy_8201@GOTPAGE
Lloh4:
	ldr	x10, [x10, _e1000_phy_8201@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_2
; %bb.1:
Lloh6:
	adrp	x9, _AUTONEG_ADVERTISE_10_100_ALL@GOTPAGE
Lloh7:
	ldr	x9, [x9, _AUTONEG_ADVERTISE_10_100_ALL@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	and	w8, w8, w9
	str	w8, [x19, #24]
LBB0_2:
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_e_dbg
	mov	x0, x19
	bl	_e1000_phy_setup_autoneg
	cbz	x0, LBB0_4
; %bb.3:
	mov	x20, x0
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_e_dbg
	b	LBB0_10
LBB0_4:
Lloh13:
	adrp	x0, l_.str.2@PAGE
Lloh14:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_e_dbg
Lloh15:
	adrp	x21, _PHY_CTRL@GOTPAGE
Lloh16:
	ldr	x21, [x21, _PHY_CTRL@GOTPAGEOFF]
	ldr	w1, [x21]
	add	x2, sp, #12
	mov	x0, x19
	bl	_e1000_read_phy_reg
	mov	x20, x0
	cbnz	x0, LBB0_10
; %bb.5:
Lloh17:
	adrp	x8, _MII_CR_AUTO_NEG_EN@GOTPAGE
Lloh18:
	ldr	x8, [x8, _MII_CR_AUTO_NEG_EN@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
Lloh20:
	adrp	x9, _MII_CR_RESTART_AUTO_NEG@GOTPAGE
Lloh21:
	ldr	x9, [x9, _MII_CR_RESTART_AUTO_NEG@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	w9, [sp, #12]
	orr	w2, w8, w9
	str	w2, [sp, #12]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_e1000_write_phy_reg
	mov	x20, x0
	cbnz	x0, LBB0_10
; %bb.6:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_9
; %bb.7:
	mov	x0, x19
	bl	_e1000_wait_autoneg
	cbz	x0, LBB0_9
; %bb.8:
	mov	x20, x0
Lloh23:
	adrp	x0, l_.str.3@PAGE
Lloh24:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_e_dbg
	b	LBB0_10
LBB0_9:
	mov	w8, #1
	str	w8, [x19, #8]
Lloh25:
	adrp	x8, _E1000_SUCCESS@GOTPAGE
Lloh26:
	ldr	x8, [x8, _E1000_SUCCESS@GOTPAGEOFF]
Lloh27:
	ldr	x20, [x8]
LBB0_10:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_AUTONEG_ADVERTISE_SPEED_DEFAULT,4,2 ; @AUTONEG_ADVERTISE_SPEED_DEFAULT
	.comm	_e1000_phy_8201,8,3             ; @e1000_phy_8201
	.comm	_AUTONEG_ADVERTISE_10_100_ALL,4,2 ; @AUTONEG_ADVERTISE_10_100_ALL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Reconfiguring auto-neg advertisement params\n"

l_.str.1:                               ; @.str.1
	.asciz	"Error Setting up Auto-Negotiation\n"

l_.str.2:                               ; @.str.2
	.asciz	"Restarting Auto-Neg\n"

	.comm	_PHY_CTRL,4,2                   ; @PHY_CTRL
	.comm	_MII_CR_AUTO_NEG_EN,4,2         ; @MII_CR_AUTO_NEG_EN
	.comm	_MII_CR_RESTART_AUTO_NEG,4,2    ; @MII_CR_RESTART_AUTO_NEG
l_.str.3:                               ; @.str.3
	.asciz	"Error while waiting for autoneg to complete\n"

	.comm	_E1000_SUCCESS,8,3              ; @E1000_SUCCESS
	.no_dead_strip	_e1000_copper_link_autoneg
.subsections_via_symbols
