	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function calibrate_xgm
_calibrate_xgm:                         ## @calibrate_xgm
	.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, %r12
	callq	_uses_xaui
	testq	%rax, %rax
	je	LBB0_8
## %bb.1:
	movq	_A_XGM_XAUI_IMP@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	xorl	%r14d, %r14d
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_t3_write_reg
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_t3_read_reg
	movl	$1, %edi
	callq	_msleep
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_t3_read_reg
	movq	_F_XGM_CALFAULT@GOTPCREL(%rip), %r15
	movq	_F_CALBUSY@GOTPCREL(%rip), %r13
	movl	(%r13), %ecx
	orl	(%r15), %ecx
	testl	%eax, %ecx
	je	LBB0_7
## %bb.2:
	movl	(%rbx), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_t3_write_reg
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_t3_read_reg
	movl	$1, %edi
	callq	_msleep
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_t3_read_reg
	movl	(%r13), %ecx
	orl	(%r15), %ecx
	testl	%eax, %ecx
	je	LBB0_7
## %bb.3:
	movl	(%rbx), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_t3_write_reg
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_t3_read_reg
	movl	$1, %edi
	callq	_msleep
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_t3_read_reg
	movl	(%r13), %ecx
	orl	(%r15), %ecx
	testl	%eax, %ecx
	je	LBB0_7
## %bb.4:
	movl	(%rbx), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_t3_write_reg
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_t3_read_reg
	movl	$1, %edi
	callq	_msleep
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_t3_read_reg
	movl	(%r13), %ecx
	orl	(%r15), %ecx
	testl	%eax, %ecx
	je	LBB0_7
## %bb.5:
	movl	(%rbx), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_t3_write_reg
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_t3_read_reg
	movl	$1, %edi
	callq	_msleep
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_t3_read_reg
	movl	(%r13), %ecx
	orl	(%r15), %ecx
	testl	%eax, %ecx
	je	LBB0_7
## %bb.6:
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	callq	_CH_ERR
	movl	$-1, %r14d
	jmp	LBB0_9
LBB0_7:
	movl	(%rbx), %r15d
	movl	%eax, %edi
	callq	_G_CALIMP
	sarl	$2, %eax
	movl	%eax, %edi
	callq	_V_XAUIIMP
	movq	%r12, %rdi
	movl	%r15d, %esi
	movl	%eax, %edx
	callq	_t3_write_reg
	jmp	LBB0_9
LBB0_8:
	movq	_A_XGM_RGMII_IMP@GOTPCREL(%rip), %r15
	movl	(%r15), %r14d
	movl	$2, %edi
	callq	_V_RGMIIIMPPD
	movl	%eax, %ebx
	movl	$3, %edi
	callq	_V_RGMIIIMPPU
	orl	%eax, %ebx
	movq	%r12, %rdi
	movl	%r14d, %esi
	movl	%ebx, %edx
	callq	_t3_write_reg
	movl	(%r15), %esi
	movq	_F_XGM_IMPSETUPDATE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r12, %rdi
	movl	%ecx, %edx
	callq	_t3_set_reg_field
	xorl	%r14d, %r14d
LBB0_9:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_A_XGM_XAUI_IMP,4,2             ## @A_XGM_XAUI_IMP
	.comm	_F_XGM_CALFAULT,4,2             ## @F_XGM_CALFAULT
	.comm	_F_CALBUSY,4,2                  ## @F_CALBUSY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"MAC calibration failed\n"

	.comm	_A_XGM_RGMII_IMP,4,2            ## @A_XGM_RGMII_IMP
	.comm	_F_XGM_IMPSETUPDATE,4,2         ## @F_XGM_IMPSETUPDATE
	.no_dead_strip	_calibrate_xgm
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function calibrate_xgm
_calibrate_xgm:                         ; @calibrate_xgm
	.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
	mov	x19, x0
	bl	_uses_xaui
	cbz	x0, LBB0_8
; %bb.1:
Lloh0:
	adrp	x20, _A_XGM_XAUI_IMP@GOTPAGE
Lloh1:
	ldr	x20, [x20, _A_XGM_XAUI_IMP@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	mov	w2, #0
	bl	_t3_write_reg
	ldr	w1, [x20]
	mov	x0, x19
	bl	_t3_read_reg
	mov	w0, #1
	bl	_msleep
	ldr	w1, [x20]
	mov	x0, x19
	bl	_t3_read_reg
Lloh2:
	adrp	x21, _F_XGM_CALFAULT@GOTPAGE
Lloh3:
	ldr	x21, [x21, _F_XGM_CALFAULT@GOTPAGEOFF]
	ldr	w8, [x21]
Lloh4:
	adrp	x22, _F_CALBUSY@GOTPAGE
Lloh5:
	ldr	x22, [x22, _F_CALBUSY@GOTPAGEOFF]
	ldr	w9, [x22]
	orr	w8, w9, w8
	tst	w8, w0
	b.eq	LBB0_7
; %bb.2:
	ldr	w1, [x20]
	mov	x0, x19
	mov	w2, #0
	bl	_t3_write_reg
	ldr	w1, [x20]
	mov	x0, x19
	bl	_t3_read_reg
	mov	w0, #1
	bl	_msleep
	ldr	w1, [x20]
	mov	x0, x19
	bl	_t3_read_reg
	ldr	w8, [x21]
	ldr	w9, [x22]
	orr	w8, w9, w8
	tst	w8, w0
	b.eq	LBB0_7
; %bb.3:
	ldr	w1, [x20]
	mov	x0, x19
	mov	w2, #0
	bl	_t3_write_reg
	ldr	w1, [x20]
	mov	x0, x19
	bl	_t3_read_reg
	mov	w0, #1
	bl	_msleep
	ldr	w1, [x20]
	mov	x0, x19
	bl	_t3_read_reg
	ldr	w8, [x21]
	ldr	w9, [x22]
	orr	w8, w9, w8
	tst	w8, w0
	b.eq	LBB0_7
; %bb.4:
	ldr	w1, [x20]
	mov	x0, x19
	mov	w2, #0
	bl	_t3_write_reg
	ldr	w1, [x20]
	mov	x0, x19
	bl	_t3_read_reg
	mov	w0, #1
	bl	_msleep
	ldr	w1, [x20]
	mov	x0, x19
	bl	_t3_read_reg
	ldr	w8, [x21]
	ldr	w9, [x22]
	orr	w8, w9, w8
	tst	w8, w0
	b.eq	LBB0_7
; %bb.5:
	ldr	w1, [x20]
	mov	x0, x19
	mov	w2, #0
	bl	_t3_write_reg
	ldr	w1, [x20]
	mov	x0, x19
	bl	_t3_read_reg
	mov	w0, #1
	bl	_msleep
	ldr	w1, [x20]
	mov	x0, x19
	bl	_t3_read_reg
	ldr	w8, [x21]
	ldr	w9, [x22]
	orr	w8, w9, w8
	tst	w8, w0
	b.eq	LBB0_7
; %bb.6:
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_CH_ERR
	mov	w0, #-1
	b	LBB0_10
LBB0_7:
	ldr	w20, [x20]
	bl	_G_CALIMP
	asr	w0, w0, #2
	bl	_V_XAUIIMP
	mov	x2, x0
	mov	x0, x19
	mov	x1, x20
	bl	_t3_write_reg
	b	LBB0_9
LBB0_8:
Lloh8:
	adrp	x22, _A_XGM_RGMII_IMP@GOTPAGE
Lloh9:
	ldr	x22, [x22, _A_XGM_RGMII_IMP@GOTPAGEOFF]
	ldr	w20, [x22]
	mov	w0, #2
	bl	_V_RGMIIIMPPD
	mov	x21, x0
	mov	w0, #3
	bl	_V_RGMIIIMPPU
	orr	w2, w0, w21
	mov	x0, x19
	mov	x1, x20
	bl	_t3_write_reg
	ldr	w1, [x22]
Lloh10:
	adrp	x8, _F_XGM_IMPSETUPDATE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _F_XGM_IMPSETUPDATE@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x3, x2
	bl	_t3_set_reg_field
LBB0_9:
	mov	w0, #0
LBB0_10:
	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
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_A_XGM_XAUI_IMP,4,2             ; @A_XGM_XAUI_IMP
	.comm	_F_XGM_CALFAULT,4,2             ; @F_XGM_CALFAULT
	.comm	_F_CALBUSY,4,2                  ; @F_CALBUSY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"MAC calibration failed\n"

	.comm	_A_XGM_RGMII_IMP,4,2            ; @A_XGM_RGMII_IMP
	.comm	_F_XGM_IMPSETUPDATE,4,2         ; @F_XGM_IMPSETUPDATE
	.no_dead_strip	_calibrate_xgm
.subsections_via_symbols
