	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function e1000_copper_link_mgp_setup
_e1000_copper_link_mgp_setup:           ## @e1000_copper_link_mgp_setup
	.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
	leaq	L_.str(%rip), %rdi
	callq	_e_dbg
	cmpq	$0, 24(%r14)
	je	LBB0_1
LBB0_21:
	movq	_E1000_SUCCESS@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	jmp	LBB0_22
LBB0_1:
	movq	_M88E1000_PHY_SPEC_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_22
## %bb.2:
	movq	_M88E1000_PSCR_ASSERT_CRS_ON_TX@GOTPCREL(%rip), %rax
	movl	-28(%rbp), %ecx
	orl	(%rax), %ecx
	movq	_M88E1000_PSCR_AUTO_X_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%edx, %eax
	notl	%eax
	andl	%ecx, %eax
	movl	(%r14), %esi
	cmpl	$3, %esi
	je	LBB0_7
## %bb.3:
	cmpl	$2, %esi
	je	LBB0_6
## %bb.4:
	cmpl	$1, %esi
	jne	LBB0_8
## %bb.5:
	movq	_M88E1000_PSCR_MDI_MANUAL_MODE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	jmp	LBB0_9
LBB0_7:
	movq	_M88E1000_PSCR_AUTO_X_1000T@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	jmp	LBB0_9
LBB0_6:
	movq	_M88E1000_PSCR_MDIX_MANUAL_MODE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	jmp	LBB0_9
LBB0_8:
	orl	%ecx, %edx
	movl	%edx, %eax
LBB0_9:
	movq	_M88E1000_PSCR_POLARITY_REVERSAL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, %edx
	notl	%edx
	andl	%eax, %edx
	movl	%edx, -28(%rbp)
	cmpl	$1, 4(%r14)
	jne	LBB0_11
## %bb.10:
	orl	%ecx, %eax
	movl	%eax, -28(%rbp)
	movl	%eax, %edx
LBB0_11:
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_e1000_write_phy_reg
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_12
LBB0_22:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	8(%r14), %rax
	movq	_M88E1011_I_REV_4@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_19
## %bb.13:
	movq	_M88E1000_EXT_PHY_SPEC_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_22
## %bb.14:
	movq	_M88E1000_EPSCR_TX_CLK_25@GOTPCREL(%rip), %rax
	movl	-28(%rbp), %edx
	orl	(%rax), %edx
	movq	8(%r14), %rax
	movq	_E1000_REVISION_2@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_17
## %bb.15:
	movq	16(%r14), %rax
	movq	_M88E1111_I_PHY_ID@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_17
## %bb.16:
	movq	_M88EC018_EPSCR_DOWNSHIFT_COUNTER_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, %edx
	movq	_M88EC018_EPSCR_DOWNSHIFT_COUNTER_5X@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	jmp	LBB0_18
LBB0_17:
	movq	_M88E1000_EPSCR_MASTER_DOWNSHIFT_MASK@GOTPCREL(%rip), %rax
	movq	_M88E1000_EPSCR_SLAVE_DOWNSHIFT_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	notl	%ecx
	andl	%ecx, %edx
	movq	_M88E1000_EPSCR_MASTER_DOWNSHIFT_1X@GOTPCREL(%rip), %rax
	movq	_M88E1000_EPSCR_SLAVE_DOWNSHIFT_1X@GOTPCREL(%rip), %rcx
	orl	(%rax), %edx
	orl	(%rcx), %edx
LBB0_18:
	movl	%edx, -28(%rbp)
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_e1000_write_phy_reg
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_22
LBB0_19:
	movq	%r14, %rdi
	callq	_e1000_phy_reset
	testq	%rax, %rax
	je	LBB0_21
## %bb.20:
	movq	%rax, %rbx
	leaq	L_.str.1(%rip), %rdi
	callq	_e_dbg
	jmp	LBB0_22
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"e1000_copper_link_mgp_setup"

	.comm	_E1000_SUCCESS,8,3              ## @E1000_SUCCESS
	.comm	_M88E1000_PHY_SPEC_CTRL,4,2     ## @M88E1000_PHY_SPEC_CTRL
	.comm	_M88E1000_PSCR_ASSERT_CRS_ON_TX,4,2 ## @M88E1000_PSCR_ASSERT_CRS_ON_TX
	.comm	_M88E1000_PSCR_AUTO_X_MODE,4,2  ## @M88E1000_PSCR_AUTO_X_MODE
	.comm	_M88E1000_PSCR_MDI_MANUAL_MODE,4,2 ## @M88E1000_PSCR_MDI_MANUAL_MODE
	.comm	_M88E1000_PSCR_MDIX_MANUAL_MODE,4,2 ## @M88E1000_PSCR_MDIX_MANUAL_MODE
	.comm	_M88E1000_PSCR_AUTO_X_1000T,4,2 ## @M88E1000_PSCR_AUTO_X_1000T
	.comm	_M88E1000_PSCR_POLARITY_REVERSAL,4,2 ## @M88E1000_PSCR_POLARITY_REVERSAL
	.comm	_M88E1011_I_REV_4,8,3           ## @M88E1011_I_REV_4
	.comm	_M88E1000_EXT_PHY_SPEC_CTRL,4,2 ## @M88E1000_EXT_PHY_SPEC_CTRL
	.comm	_M88E1000_EPSCR_TX_CLK_25,4,2   ## @M88E1000_EPSCR_TX_CLK_25
	.comm	_E1000_REVISION_2,8,3           ## @E1000_REVISION_2
	.comm	_M88E1111_I_PHY_ID,8,3          ## @M88E1111_I_PHY_ID
	.comm	_M88EC018_EPSCR_DOWNSHIFT_COUNTER_MASK,4,2 ## @M88EC018_EPSCR_DOWNSHIFT_COUNTER_MASK
	.comm	_M88EC018_EPSCR_DOWNSHIFT_COUNTER_5X,4,2 ## @M88EC018_EPSCR_DOWNSHIFT_COUNTER_5X
	.comm	_M88E1000_EPSCR_MASTER_DOWNSHIFT_MASK,4,2 ## @M88E1000_EPSCR_MASTER_DOWNSHIFT_MASK
	.comm	_M88E1000_EPSCR_SLAVE_DOWNSHIFT_MASK,4,2 ## @M88E1000_EPSCR_SLAVE_DOWNSHIFT_MASK
	.comm	_M88E1000_EPSCR_MASTER_DOWNSHIFT_1X,4,2 ## @M88E1000_EPSCR_MASTER_DOWNSHIFT_1X
	.comm	_M88E1000_EPSCR_SLAVE_DOWNSHIFT_1X,4,2 ## @M88E1000_EPSCR_SLAVE_DOWNSHIFT_1X
L_.str.1:                               ## @.str.1
	.asciz	"Error Resetting the PHY\n"

	.no_dead_strip	_e1000_copper_link_mgp_setup
.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_mgp_setup
_e1000_copper_link_mgp_setup:           ; @e1000_copper_link_mgp_setup
	.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	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_e_dbg
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_2
LBB0_1:
Lloh2:
	adrp	x8, _E1000_SUCCESS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _E1000_SUCCESS@GOTPAGEOFF]
Lloh4:
	ldr	x20, [x8]
	b	LBB0_14
LBB0_2:
Lloh5:
	adrp	x21, _M88E1000_PHY_SPEC_CTRL@GOTPAGE
Lloh6:
	ldr	x21, [x21, _M88E1000_PHY_SPEC_CTRL@GOTPAGEOFF]
	ldr	w1, [x21]
	add	x2, sp, #12
	mov	x0, x19
	bl	_e1000_read_phy_reg
	mov	x20, x0
	cbnz	x0, LBB0_14
; %bb.3:
Lloh7:
	adrp	x8, _M88E1000_PSCR_ASSERT_CRS_ON_TX@GOTPAGE
Lloh8:
	ldr	x8, [x8, _M88E1000_PSCR_ASSERT_CRS_ON_TX@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	ldr	w9, [sp, #12]
	orr	w9, w9, w8
Lloh10:
	adrp	x8, _M88E1000_PSCR_AUTO_X_MODE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _M88E1000_PSCR_AUTO_X_MODE@GOTPAGEOFF]
Lloh12:
	ldr	w10, [x8]
	bic	w8, w9, w10
	ldr	w11, [x19]
	cmp	w11, #3
	b.eq	LBB0_7
; %bb.4:
	cmp	w11, #2
	b.eq	LBB0_8
; %bb.5:
	cmp	w11, #1
	b.ne	LBB0_10
; %bb.6:
Lloh13:
	adrp	x9, _M88E1000_PSCR_MDI_MANUAL_MODE@GOTPAGE
Lloh14:
	ldr	x9, [x9, _M88E1000_PSCR_MDI_MANUAL_MODE@GOTPAGEOFF]
	b	LBB0_9
LBB0_7:
Lloh15:
	adrp	x9, _M88E1000_PSCR_AUTO_X_1000T@GOTPAGE
Lloh16:
	ldr	x9, [x9, _M88E1000_PSCR_AUTO_X_1000T@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:
Lloh17:
	adrp	x9, _M88E1000_PSCR_MDIX_MANUAL_MODE@GOTPAGE
Lloh18:
	ldr	x9, [x9, _M88E1000_PSCR_MDIX_MANUAL_MODE@GOTPAGEOFF]
LBB0_9:
	ldr	w9, [x9]
	orr	w8, w9, w8
	b	LBB0_11
LBB0_10:
	orr	w8, w10, w9
LBB0_11:
Lloh19:
	adrp	x9, _M88E1000_PSCR_POLARITY_REVERSAL@GOTPAGE
Lloh20:
	ldr	x9, [x9, _M88E1000_PSCR_POLARITY_REVERSAL@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	bic	w2, w8, w9
	str	w2, [sp, #12]
	ldr	w10, [x19, #4]
	cmp	w10, #1
	b.ne	LBB0_13
; %bb.12:
	orr	w2, w8, w9
	str	w2, [sp, #12]
LBB0_13:
	ldr	w1, [x21]
	mov	x0, x19
	bl	_e1000_write_phy_reg
	mov	x20, x0
	cbz	x0, LBB0_15
LBB0_14:
	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
LBB0_15:
	ldr	x8, [x19, #8]
Lloh22:
	adrp	x9, _M88E1011_I_REV_4@GOTPAGE
Lloh23:
	ldr	x9, [x9, _M88E1011_I_REV_4@GOTPAGEOFF]
Lloh24:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_22
; %bb.16:
Lloh25:
	adrp	x21, _M88E1000_EXT_PHY_SPEC_CTRL@GOTPAGE
Lloh26:
	ldr	x21, [x21, _M88E1000_EXT_PHY_SPEC_CTRL@GOTPAGEOFF]
	ldr	w1, [x21]
	add	x2, sp, #12
	mov	x0, x19
	bl	_e1000_read_phy_reg
	mov	x20, x0
	cbnz	x0, LBB0_14
; %bb.17:
Lloh27:
	adrp	x8, _M88E1000_EPSCR_TX_CLK_25@GOTPAGE
Lloh28:
	ldr	x8, [x8, _M88E1000_EPSCR_TX_CLK_25@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	ldr	w9, [sp, #12]
	orr	w8, w9, w8
	ldr	x9, [x19, #8]
Lloh30:
	adrp	x10, _E1000_REVISION_2@GOTPAGE
Lloh31:
	ldr	x10, [x10, _E1000_REVISION_2@GOTPAGEOFF]
Lloh32:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_20
; %bb.18:
	ldr	x9, [x19, #16]
Lloh33:
	adrp	x10, _M88E1111_I_PHY_ID@GOTPAGE
Lloh34:
	ldr	x10, [x10, _M88E1111_I_PHY_ID@GOTPAGEOFF]
Lloh35:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_20
; %bb.19:
Lloh36:
	adrp	x9, _M88EC018_EPSCR_DOWNSHIFT_COUNTER_MASK@GOTPAGE
Lloh37:
	ldr	x9, [x9, _M88EC018_EPSCR_DOWNSHIFT_COUNTER_MASK@GOTPAGEOFF]
Lloh38:
	ldr	w9, [x9]
	bic	w8, w8, w9
Lloh39:
	adrp	x9, _M88EC018_EPSCR_DOWNSHIFT_COUNTER_5X@GOTPAGE
Lloh40:
	ldr	x9, [x9, _M88EC018_EPSCR_DOWNSHIFT_COUNTER_5X@GOTPAGEOFF]
Lloh41:
	ldr	w9, [x9]
	orr	w2, w9, w8
	b	LBB0_21
LBB0_20:
Lloh42:
	adrp	x9, _M88E1000_EPSCR_MASTER_DOWNSHIFT_MASK@GOTPAGE
Lloh43:
	ldr	x9, [x9, _M88E1000_EPSCR_MASTER_DOWNSHIFT_MASK@GOTPAGEOFF]
Lloh44:
	ldr	w9, [x9]
Lloh45:
	adrp	x10, _M88E1000_EPSCR_SLAVE_DOWNSHIFT_MASK@GOTPAGE
Lloh46:
	ldr	x10, [x10, _M88E1000_EPSCR_SLAVE_DOWNSHIFT_MASK@GOTPAGEOFF]
Lloh47:
	ldr	w10, [x10]
	orr	w9, w10, w9
	bic	w8, w8, w9
Lloh48:
	adrp	x9, _M88E1000_EPSCR_MASTER_DOWNSHIFT_1X@GOTPAGE
Lloh49:
	ldr	x9, [x9, _M88E1000_EPSCR_MASTER_DOWNSHIFT_1X@GOTPAGEOFF]
Lloh50:
	adrp	x10, _M88E1000_EPSCR_SLAVE_DOWNSHIFT_1X@GOTPAGE
Lloh51:
	ldr	x10, [x10, _M88E1000_EPSCR_SLAVE_DOWNSHIFT_1X@GOTPAGEOFF]
Lloh52:
	ldr	w9, [x9]
Lloh53:
	ldr	w10, [x10]
	orr	w8, w8, w9
	orr	w2, w8, w10
LBB0_21:
	str	w2, [sp, #12]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_e1000_write_phy_reg
	mov	x20, x0
	cbnz	x0, LBB0_14
LBB0_22:
	mov	x0, x19
	bl	_e1000_phy_reset
	cbz	x0, LBB0_1
; %bb.23:
	mov	x20, x0
Lloh54:
	adrp	x0, l_.str.1@PAGE
Lloh55:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_e_dbg
	b	LBB0_14
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh53
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh52
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpAdd	Lloh54, Lloh55
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"e1000_copper_link_mgp_setup"

	.comm	_E1000_SUCCESS,8,3              ; @E1000_SUCCESS
	.comm	_M88E1000_PHY_SPEC_CTRL,4,2     ; @M88E1000_PHY_SPEC_CTRL
	.comm	_M88E1000_PSCR_ASSERT_CRS_ON_TX,4,2 ; @M88E1000_PSCR_ASSERT_CRS_ON_TX
	.comm	_M88E1000_PSCR_AUTO_X_MODE,4,2  ; @M88E1000_PSCR_AUTO_X_MODE
	.comm	_M88E1000_PSCR_MDI_MANUAL_MODE,4,2 ; @M88E1000_PSCR_MDI_MANUAL_MODE
	.comm	_M88E1000_PSCR_MDIX_MANUAL_MODE,4,2 ; @M88E1000_PSCR_MDIX_MANUAL_MODE
	.comm	_M88E1000_PSCR_AUTO_X_1000T,4,2 ; @M88E1000_PSCR_AUTO_X_1000T
	.comm	_M88E1000_PSCR_POLARITY_REVERSAL,4,2 ; @M88E1000_PSCR_POLARITY_REVERSAL
	.comm	_M88E1011_I_REV_4,8,3           ; @M88E1011_I_REV_4
	.comm	_M88E1000_EXT_PHY_SPEC_CTRL,4,2 ; @M88E1000_EXT_PHY_SPEC_CTRL
	.comm	_M88E1000_EPSCR_TX_CLK_25,4,2   ; @M88E1000_EPSCR_TX_CLK_25
	.comm	_E1000_REVISION_2,8,3           ; @E1000_REVISION_2
	.comm	_M88E1111_I_PHY_ID,8,3          ; @M88E1111_I_PHY_ID
	.comm	_M88EC018_EPSCR_DOWNSHIFT_COUNTER_MASK,4,2 ; @M88EC018_EPSCR_DOWNSHIFT_COUNTER_MASK
	.comm	_M88EC018_EPSCR_DOWNSHIFT_COUNTER_5X,4,2 ; @M88EC018_EPSCR_DOWNSHIFT_COUNTER_5X
	.comm	_M88E1000_EPSCR_MASTER_DOWNSHIFT_MASK,4,2 ; @M88E1000_EPSCR_MASTER_DOWNSHIFT_MASK
	.comm	_M88E1000_EPSCR_SLAVE_DOWNSHIFT_MASK,4,2 ; @M88E1000_EPSCR_SLAVE_DOWNSHIFT_MASK
	.comm	_M88E1000_EPSCR_MASTER_DOWNSHIFT_1X,4,2 ; @M88E1000_EPSCR_MASTER_DOWNSHIFT_1X
	.comm	_M88E1000_EPSCR_SLAVE_DOWNSHIFT_1X,4,2 ; @M88E1000_EPSCR_SLAVE_DOWNSHIFT_1X
l_.str.1:                               ; @.str.1
	.asciz	"Error Resetting the PHY\n"

	.no_dead_strip	_e1000_copper_link_mgp_setup
.subsections_via_symbols
