	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_igb_copper_link_setup_m88_gen2 ## -- Begin function igb_copper_link_setup_m88_gen2
	.p2align	4, 0x90
_igb_copper_link_setup_m88_gen2:        ## @igb_copper_link_setup_m88_gen2
	.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
	cmpq	$0, 40(%rdi)
	je	LBB0_2
## %bb.1:
	xorl	%ebx, %ebx
	jmp	LBB0_20
LBB0_2:
	movq	%rdi, %r14
	movq	_M88E1000_PHY_SPEC_CTRL@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	leaq	-28(%rbp), %rdx
	callq	*32(%rdi)
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_3
LBB0_20:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	_M88E1000_PSCR_AUTO_X_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%ecx, %eax
	notl	%eax
	movl	-28(%rbp), %edx
	andl	%edx, %eax
	movl	(%r14), %esi
	cmpl	$3, %esi
	je	LBB0_9
## %bb.4:
	cmpl	$2, %esi
	je	LBB0_8
## %bb.5:
	cmpl	$1, %esi
	jne	LBB0_11
## %bb.6:
	movq	_M88E1000_PSCR_MDI_MANUAL_MODE@GOTPCREL(%rip), %rcx
	jmp	LBB0_7
LBB0_9:
	movq	8(%r14), %rsi
	movq	_M88E1112_E_PHY_ID@GOTPCREL(%rip), %rdi
	cmpq	(%rdi), %rsi
	jne	LBB0_10
LBB0_11:
	orl	%ecx, %edx
	jmp	LBB0_12
LBB0_8:
	movq	_M88E1000_PSCR_MDIX_MANUAL_MODE@GOTPCREL(%rip), %rcx
	jmp	LBB0_7
LBB0_10:
	movq	_M88E1000_PSCR_AUTO_X_1000T@GOTPCREL(%rip), %rcx
LBB0_7:
	orl	(%rcx), %eax
	movl	%eax, %edx
LBB0_12:
	movq	_M88E1000_PSCR_POLARITY_REVERSAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %ecx
	notl	%ecx
	andl	%edx, %ecx
	orl	%eax, %edx
	cmpl	$1, 16(%r14)
	cmovnel	%ecx, %edx
	movq	8(%r14), %rax
	movq	_M88E1543_E_PHY_ID@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_16
## %bb.13:
	movq	_I347AT4_PSCR_DOWNSHIFT_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, %edx
	movl	%edx, -28(%rbp)
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	*24(%r14)
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_20
## %bb.14:
	movq	%r14, %rdi
	callq	_igb_phy_sw_reset
	testq	%rax, %rax
	jne	LBB0_18
## %bb.15:
	movl	-28(%rbp), %edx
LBB0_16:
	movq	_I347AT4_PSCR_DOWNSHIFT_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%edx, %eax
	movq	_I347AT4_PSCR_DOWNSHIFT_6X@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_I347AT4_PSCR_DOWNSHIFT_ENABLE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, -28(%rbp)
	movl	(%r15), %esi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	*24(%r14)
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_20
## %bb.17:
	movq	%r14, %rdi
	callq	_igb_phy_sw_reset
	testq	%rax, %rax
	je	LBB0_19
LBB0_18:
	movq	%rax, %rbx
	leaq	L_.str(%rip), %rdi
	callq	_hw_dbg
	jmp	LBB0_20
LBB0_19:
	movq	%r14, %rdi
	callq	_igb_set_master_slave_mode
	movq	%rax, %rbx
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.comm	_M88E1000_PHY_SPEC_CTRL,4,2     ## @M88E1000_PHY_SPEC_CTRL
	.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	_M88E1112_E_PHY_ID,8,3          ## @M88E1112_E_PHY_ID
	.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	_M88E1543_E_PHY_ID,8,3          ## @M88E1543_E_PHY_ID
	.comm	_I347AT4_PSCR_DOWNSHIFT_ENABLE,4,2 ## @I347AT4_PSCR_DOWNSHIFT_ENABLE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error committing the PHY changes\n"

	.comm	_I347AT4_PSCR_DOWNSHIFT_MASK,4,2 ## @I347AT4_PSCR_DOWNSHIFT_MASK
	.comm	_I347AT4_PSCR_DOWNSHIFT_6X,4,2  ## @I347AT4_PSCR_DOWNSHIFT_6X
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_igb_copper_link_setup_m88_gen2 ; -- Begin function igb_copper_link_setup_m88_gen2
	.p2align	2
_igb_copper_link_setup_m88_gen2:        ; @igb_copper_link_setup_m88_gen2
	.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
	ldr	x8, [x0, #40]
	cbz	x8, LBB0_2
; %bb.1:
	mov	x20, #0
	b	LBB0_3
LBB0_2:
	mov	x19, x0
	ldr	x8, [x0, #32]
Lloh0:
	adrp	x21, _M88E1000_PHY_SPEC_CTRL@GOTPAGE
Lloh1:
	ldr	x21, [x21, _M88E1000_PHY_SPEC_CTRL@GOTPAGEOFF]
	ldr	w1, [x21]
	add	x2, sp, #12
	blr	x8
	mov	x20, x0
	cbz	x0, LBB0_4
LBB0_3:
	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_4:
Lloh2:
	adrp	x8, _M88E1000_PSCR_AUTO_X_MODE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _M88E1000_PSCR_AUTO_X_MODE@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x8]
	ldr	w10, [sp, #12]
	bic	w8, w10, w9
	ldr	w11, [x19]
	cmp	w11, #3
	b.eq	LBB0_8
; %bb.5:
	cmp	w11, #2
	b.eq	LBB0_10
; %bb.6:
	cmp	w11, #1
	b.ne	LBB0_9
; %bb.7:
Lloh5:
	adrp	x9, _M88E1000_PSCR_MDI_MANUAL_MODE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _M88E1000_PSCR_MDI_MANUAL_MODE@GOTPAGEOFF]
	b	LBB0_12
LBB0_8:
	ldr	x11, [x19, #8]
Lloh7:
	adrp	x12, _M88E1112_E_PHY_ID@GOTPAGE
Lloh8:
	ldr	x12, [x12, _M88E1112_E_PHY_ID@GOTPAGEOFF]
Lloh9:
	ldr	x12, [x12]
	cmp	x11, x12
	b.ne	LBB0_11
LBB0_9:
	orr	w8, w10, w9
	b	LBB0_13
LBB0_10:
Lloh10:
	adrp	x9, _M88E1000_PSCR_MDIX_MANUAL_MODE@GOTPAGE
Lloh11:
	ldr	x9, [x9, _M88E1000_PSCR_MDIX_MANUAL_MODE@GOTPAGEOFF]
	b	LBB0_12
LBB0_11:
Lloh12:
	adrp	x9, _M88E1000_PSCR_AUTO_X_1000T@GOTPAGE
Lloh13:
	ldr	x9, [x9, _M88E1000_PSCR_AUTO_X_1000T@GOTPAGEOFF]
LBB0_12:
	ldr	w9, [x9]
	orr	w8, w9, w8
LBB0_13:
Lloh14:
	adrp	x9, _M88E1000_PSCR_POLARITY_REVERSAL@GOTPAGE
Lloh15:
	ldr	x9, [x9, _M88E1000_PSCR_POLARITY_REVERSAL@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	bic	w10, w8, w9
	ldr	w11, [x19, #16]
	orr	w8, w8, w9
	cmp	w11, #1
	csel	w8, w8, w10, eq
	ldr	x9, [x19, #8]
Lloh17:
	adrp	x10, _M88E1543_E_PHY_ID@GOTPAGE
Lloh18:
	ldr	x10, [x10, _M88E1543_E_PHY_ID@GOTPAGEOFF]
Lloh19:
	ldr	x10, [x10]
Lloh20:
	adrp	x22, _I347AT4_PSCR_DOWNSHIFT_ENABLE@GOTPAGE
Lloh21:
	ldr	x22, [x22, _I347AT4_PSCR_DOWNSHIFT_ENABLE@GOTPAGEOFF]
	cmp	x9, x10
	b.ne	LBB0_17
; %bb.14:
	ldr	w9, [x22]
	bic	w2, w8, w9
	str	w2, [sp, #12]
	ldr	x8, [x19, #24]
	ldr	w1, [x21]
	mov	x0, x19
	blr	x8
	mov	x20, x0
	cbnz	x0, LBB0_3
; %bb.15:
	mov	x0, x19
	bl	_igb_phy_sw_reset
	cbnz	x0, LBB0_19
; %bb.16:
	ldr	w8, [sp, #12]
LBB0_17:
Lloh22:
	adrp	x9, _I347AT4_PSCR_DOWNSHIFT_MASK@GOTPAGE
Lloh23:
	ldr	x9, [x9, _I347AT4_PSCR_DOWNSHIFT_MASK@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	bic	w8, w8, w9
Lloh25:
	adrp	x9, _I347AT4_PSCR_DOWNSHIFT_6X@GOTPAGE
Lloh26:
	ldr	x9, [x9, _I347AT4_PSCR_DOWNSHIFT_6X@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	w9, [x22]
	orr	w2, w9, w8
	str	w2, [sp, #12]
	ldr	x8, [x19, #24]
	ldr	w1, [x21]
	mov	x0, x19
	blr	x8
	mov	x20, x0
	cbnz	x0, LBB0_3
; %bb.18:
	mov	x0, x19
	bl	_igb_phy_sw_reset
	cbz	x0, LBB0_20
LBB0_19:
	mov	x20, x0
Lloh28:
	adrp	x0, l_.str@PAGE
Lloh29:
	add	x0, x0, l_.str@PAGEOFF
	bl	_hw_dbg
	b	LBB0_3
LBB0_20:
	mov	x0, x19
	bl	_igb_set_master_slave_mode
	mov	x20, x0
	b	LBB0_3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_M88E1000_PHY_SPEC_CTRL,4,2     ; @M88E1000_PHY_SPEC_CTRL
	.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	_M88E1112_E_PHY_ID,8,3          ; @M88E1112_E_PHY_ID
	.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	_M88E1543_E_PHY_ID,8,3          ; @M88E1543_E_PHY_ID
	.comm	_I347AT4_PSCR_DOWNSHIFT_ENABLE,4,2 ; @I347AT4_PSCR_DOWNSHIFT_ENABLE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error committing the PHY changes\n"

	.comm	_I347AT4_PSCR_DOWNSHIFT_MASK,4,2 ; @I347AT4_PSCR_DOWNSHIFT_MASK
	.comm	_I347AT4_PSCR_DOWNSHIFT_6X,4,2  ; @I347AT4_PSCR_DOWNSHIFT_6X
.subsections_via_symbols
