	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mac_prep
_mac_prep:                              ## @mac_prep
	.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
	movl	%edx, %r15d
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	%rsi, 8(%rdi)
	movl	16(%rsi), %edi
	leaq	-28(%rbp), %rdx
	movl	$2, %esi
	callq	_pci_read_config_word
	cmpl	$55, -28(%rbp)
	jne	LBB0_2
## %bb.1:
	movq	8(%rbx), %rax
	movl	4(%rax), %eax
	testl	%eax, %eax
	cmovel	%eax, %r15d
LBB0_2:
	movq	_XGMAC0_1_BASE_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_XGMAC0_0_BASE_ADDR@GOTPCREL(%rip), %rcx
	subl	(%rcx), %eax
	imull	%r15d, %eax
	movl	%eax, (%r14)
	movl	$1, 4(%r14)
	cmpq	$0, (%rbx)
	jne	LBB0_5
## %bb.3:
	movq	%rbx, %rdi
	callq	_uses_xaui
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	_A_XGM_SERDES_CTRL@GOTPCREL(%rip), %rax
	movslq	(%r14), %r15
	addq	(%rax), %r15
	movq	%rbx, %rdi
	callq	_is_10G
	testq	%rax, %rax
	movl	$36707332, %eax                 ## imm = 0x2301C04
	movl	$42998788, %edx                 ## imm = 0x2901C04
	cmovel	%eax, %edx
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_t3_write_reg
	movq	_A_XGM_PORT_CFG@GOTPCREL(%rip), %rax
	movslq	(%r14), %rsi
	addq	(%rax), %rsi
	movq	_F_ENRGMII@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	callq	_t3_set_reg_field
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_XGMAC0_1_BASE_ADDR,4,2         ## @XGMAC0_1_BASE_ADDR
	.comm	_XGMAC0_0_BASE_ADDR,4,2         ## @XGMAC0_0_BASE_ADDR
	.comm	_A_XGM_SERDES_CTRL,8,3          ## @A_XGM_SERDES_CTRL
	.comm	_A_XGM_PORT_CFG,8,3             ## @A_XGM_PORT_CFG
	.comm	_F_ENRGMII,4,2                  ## @F_ENRGMII
	.no_dead_strip	_mac_prep
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mac_prep
_mac_prep:                              ; @mac_prep
	.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	x21, x2
	mov	x19, x1
	mov	x20, x0
	str	x1, [x0, #8]
	ldr	w0, [x1, #16]
	add	x2, sp, #12
	mov	w1, #2
	bl	_pci_read_config_word
	ldr	w8, [sp, #12]
	cmp	w8, #55
	b.ne	LBB0_2
; %bb.1:
	ldr	x8, [x19, #8]
	ldr	w8, [x8, #4]
	cmp	w8, #0
	csel	w21, wzr, w21, eq
LBB0_2:
Lloh0:
	adrp	x8, _XGMAC0_1_BASE_ADDR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _XGMAC0_1_BASE_ADDR@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _XGMAC0_0_BASE_ADDR@GOTPAGE
Lloh4:
	ldr	x9, [x9, _XGMAC0_0_BASE_ADDR@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	sub	w8, w8, w9
	mul	w8, w8, w21
	mov	w9, #1
	stp	w8, w9, [x20]
	ldr	x8, [x19]
	cbnz	x8, LBB0_5
; %bb.3:
	mov	x0, x19
	bl	_uses_xaui
	cbz	x0, LBB0_5
; %bb.4:
Lloh6:
	adrp	x8, _A_XGM_SERDES_CTRL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _A_XGM_SERDES_CTRL@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	ldrsw	x9, [x20]
	add	x21, x8, x9
	mov	x0, x19
	bl	_is_10G
	mov	w8, #7172
	movk	w8, #560, lsl #16
	add	w9, w8, #1536, lsl #12          ; =6291456
	cmp	x0, #0
	csel	w2, w8, w9, eq
	mov	x0, x19
	mov	x1, x21
	bl	_t3_write_reg
Lloh9:
	adrp	x8, _A_XGM_PORT_CFG@GOTPAGE
Lloh10:
	ldr	x8, [x8, _A_XGM_PORT_CFG@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	ldrsw	x9, [x20]
	add	x1, x8, x9
Lloh12:
	adrp	x8, _F_ENRGMII@GOTPAGE
Lloh13:
	ldr	x8, [x8, _F_ENRGMII@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w3, #0
	bl	_t3_set_reg_field
LBB0_5:
	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	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_XGMAC0_1_BASE_ADDR,4,2         ; @XGMAC0_1_BASE_ADDR
	.comm	_XGMAC0_0_BASE_ADDR,4,2         ; @XGMAC0_0_BASE_ADDR
	.comm	_A_XGM_SERDES_CTRL,8,3          ; @A_XGM_SERDES_CTRL
	.comm	_A_XGM_PORT_CFG,8,3             ; @A_XGM_PORT_CFG
	.comm	_F_ENRGMII,4,2                  ; @F_ENRGMII
	.no_dead_strip	_mac_prep
.subsections_via_symbols
