	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bgx_lmac_sgmii_init
_bgx_lmac_sgmii_init:                   ## @bgx_lmac_sgmii_init
	.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	%rsi, %r15
	movq	%rdi, %rbx
	movl	(%rsi), %r14d
	movq	_BGX_GMP_GMI_TXX_THRESH@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r14d, %esi
	movl	$48, %ecx
	callq	_bgx_reg_modify
	movq	_BGX_GMP_GMI_RXX_JABBER@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_MAX_FRAME_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_bgx_reg_modify
	movq	_BGX_GMP_GMI_TXX_APPEND@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_bgx_reg_read
	testb	$1, %al
	je	LBB0_2
## %bb.1:
	movq	_BGX_GMP_GMI_TXX_SGMII_CTL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	xorl	%ecx, %ecx
	callq	_bgx_reg_write
LBB0_2:
	movq	_BGX_CMRX_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_CMR_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_bgx_reg_modify
	movq	_BGX_GMP_PCS_MRX_CTL@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movq	_PCS_MRX_CTL_RESET@GOTPCREL(%rip), %r13
	movl	(%r13), %ecx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_bgx_reg_modify
	movl	(%r12), %edx
	movl	(%r13), %ecx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movl	$1, %r8d
	callq	_bgx_poll_reg
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	(%rbx), %rdi
	leaq	L_.str(%rip), %rsi
LBB0_14:
	callq	_dev_err
	movl	$-1, %r12d
	jmp	LBB0_15
LBB0_4:
	movl	(%r12), %edx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_bgx_reg_read
	movq	_PCS_MRX_CTL_PWR_DN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	andl	%eax, %ecx
	movq	_PCS_MRX_CTL_RST_AN@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	cmpq	$0, 16(%r15)
	movq	_PCS_MRX_CTL_AN_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	je	LBB0_6
## %bb.5:
	orl	%eax, %ecx
	jmp	LBB0_8
LBB0_6:
	testl	%ecx, %eax
	je	LBB0_8
## %bb.7:
	movl	$1, 4(%r15)
LBB0_8:
	movl	(%r12), %edx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_bgx_reg_write
	movq	8(%r15), %rax
	movq	_BGX_MODE_QSGMII@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.9:
	movq	_BGX_GMP_PCS_MISCX_CTL@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_bgx_reg_read
	movq	_PCS_MISC_CTL_DISP_EN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	andl	%eax, %ecx
	movl	(%r15), %edx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_bgx_reg_write
	xorl	%r12d, %r12d
	jmp	LBB0_15
LBB0_10:
	movq	_BGX_MODE_SGMII@GOTPCREL(%rip), %rcx
	xorl	%r12d, %r12d
	cmpq	(%rcx), %rax
	jne	LBB0_15
## %bb.11:
	cmpq	$0, 16(%r15)
	je	LBB0_15
## %bb.12:
	movq	_BGX_GMP_PCS_MRX_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_PCS_MRX_STATUS_AN_CPT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%r12d, %r12d
	movq	%rbx, %rdi
	movl	%r14d, %esi
	xorl	%r8d, %r8d
	callq	_bgx_poll_reg
	testq	%rax, %rax
	je	LBB0_15
## %bb.13:
	movq	(%rbx), %rdi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_14
LBB0_15:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BGX_GMP_GMI_TXX_THRESH,4,2     ## @BGX_GMP_GMI_TXX_THRESH
	.comm	_BGX_GMP_GMI_RXX_JABBER,4,2     ## @BGX_GMP_GMI_RXX_JABBER
	.comm	_MAX_FRAME_SIZE,4,2             ## @MAX_FRAME_SIZE
	.comm	_BGX_GMP_GMI_TXX_APPEND,4,2     ## @BGX_GMP_GMI_TXX_APPEND
	.comm	_BGX_GMP_GMI_TXX_SGMII_CTL,4,2  ## @BGX_GMP_GMI_TXX_SGMII_CTL
	.comm	_BGX_CMRX_CFG,4,2               ## @BGX_CMRX_CFG
	.comm	_CMR_EN,4,2                     ## @CMR_EN
	.comm	_BGX_GMP_PCS_MRX_CTL,4,2        ## @BGX_GMP_PCS_MRX_CTL
	.comm	_PCS_MRX_CTL_RESET,4,2          ## @PCS_MRX_CTL_RESET
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"BGX PCS reset not completed\n"

	.comm	_PCS_MRX_CTL_PWR_DN,4,2         ## @PCS_MRX_CTL_PWR_DN
	.comm	_PCS_MRX_CTL_RST_AN,4,2         ## @PCS_MRX_CTL_RST_AN
	.comm	_PCS_MRX_CTL_AN_EN,4,2          ## @PCS_MRX_CTL_AN_EN
	.comm	_BGX_MODE_QSGMII,8,3            ## @BGX_MODE_QSGMII
	.comm	_BGX_GMP_PCS_MISCX_CTL,4,2      ## @BGX_GMP_PCS_MISCX_CTL
	.comm	_PCS_MISC_CTL_DISP_EN,4,2       ## @PCS_MISC_CTL_DISP_EN
	.comm	_BGX_MODE_SGMII,8,3             ## @BGX_MODE_SGMII
	.comm	_BGX_GMP_PCS_MRX_STATUS,4,2     ## @BGX_GMP_PCS_MRX_STATUS
	.comm	_PCS_MRX_STATUS_AN_CPT,4,2      ## @PCS_MRX_STATUS_AN_CPT
L_.str.1:                               ## @.str.1
	.asciz	"BGX AN_CPT not completed\n"

	.no_dead_strip	_bgx_lmac_sgmii_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bgx_lmac_sgmii_init
_bgx_lmac_sgmii_init:                   ; @bgx_lmac_sgmii_init
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x1
	mov	x19, x0
	ldr	w20, [x1]
Lloh0:
	adrp	x8, _BGX_GMP_GMI_TXX_THRESH@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BGX_GMP_GMI_TXX_THRESH@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x1, x20
	mov	w3, #48
	bl	_bgx_reg_modify
Lloh3:
	adrp	x8, _BGX_GMP_GMI_RXX_JABBER@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BGX_GMP_GMI_RXX_JABBER@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
Lloh6:
	adrp	x8, _MAX_FRAME_SIZE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MAX_FRAME_SIZE@GOTPAGEOFF]
Lloh8:
	ldr	w3, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_bgx_reg_modify
Lloh9:
	adrp	x8, _BGX_GMP_GMI_TXX_APPEND@GOTPAGE
Lloh10:
	ldr	x8, [x8, _BGX_GMP_GMI_TXX_APPEND@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_bgx_reg_read
	tbz	w0, #0, LBB0_2
; %bb.1:
Lloh12:
	adrp	x8, _BGX_GMP_GMI_TXX_SGMII_CTL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _BGX_GMP_GMI_TXX_SGMII_CTL@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x20
	mov	w3, #0
	bl	_bgx_reg_write
LBB0_2:
Lloh15:
	adrp	x8, _BGX_CMRX_CFG@GOTPAGE
Lloh16:
	ldr	x8, [x8, _BGX_CMRX_CFG@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
Lloh18:
	adrp	x8, _CMR_EN@GOTPAGE
Lloh19:
	ldr	x8, [x8, _CMR_EN@GOTPAGEOFF]
Lloh20:
	ldr	w3, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_bgx_reg_modify
Lloh21:
	adrp	x22, _BGX_GMP_PCS_MRX_CTL@GOTPAGE
Lloh22:
	ldr	x22, [x22, _BGX_GMP_PCS_MRX_CTL@GOTPAGEOFF]
	ldr	w2, [x22]
Lloh23:
	adrp	x23, _PCS_MRX_CTL_RESET@GOTPAGE
Lloh24:
	ldr	x23, [x23, _PCS_MRX_CTL_RESET@GOTPAGEOFF]
	ldr	w3, [x23]
	mov	x0, x19
	mov	x1, x20
	bl	_bgx_reg_modify
	ldr	w2, [x22]
	ldr	w3, [x23]
	mov	x0, x19
	mov	x1, x20
	mov	w4, #1
	bl	_bgx_poll_reg
	cbz	x0, LBB0_5
; %bb.3:
	ldr	x0, [x19]
Lloh25:
	adrp	x1, l_.str@PAGE
Lloh26:
	add	x1, x1, l_.str@PAGEOFF
LBB0_4:
	bl	_dev_err
	mov	w0, #-1
	b	LBB0_16
LBB0_5:
	ldr	w2, [x22]
	mov	x0, x19
	mov	x1, x20
	bl	_bgx_reg_read
Lloh27:
	adrp	x8, _PCS_MRX_CTL_PWR_DN@GOTPAGE
Lloh28:
	ldr	x8, [x8, _PCS_MRX_CTL_PWR_DN@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	bic	w8, w0, w8
Lloh30:
	adrp	x9, _PCS_MRX_CTL_RST_AN@GOTPAGE
Lloh31:
	ldr	x9, [x9, _PCS_MRX_CTL_RST_AN@GOTPAGEOFF]
Lloh32:
	ldr	w9, [x9]
	orr	w3, w8, w9
	ldr	x9, [x21, #16]
Lloh33:
	adrp	x8, _PCS_MRX_CTL_AN_EN@GOTPAGE
Lloh34:
	ldr	x8, [x8, _PCS_MRX_CTL_AN_EN@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	cbz	x9, LBB0_7
; %bb.6:
	orr	w3, w8, w3
	b	LBB0_9
LBB0_7:
	tst	w8, w3
	b.eq	LBB0_9
; %bb.8:
	mov	w8, #1
	str	w8, [x21, #4]
LBB0_9:
	ldr	w2, [x22]
	mov	x0, x19
	mov	x1, x20
	bl	_bgx_reg_write
	ldr	x8, [x21, #8]
Lloh36:
	adrp	x9, _BGX_MODE_QSGMII@GOTPAGE
Lloh37:
	ldr	x9, [x9, _BGX_MODE_QSGMII@GOTPAGEOFF]
Lloh38:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_11
; %bb.10:
Lloh39:
	adrp	x21, _BGX_GMP_PCS_MISCX_CTL@GOTPAGE
Lloh40:
	ldr	x21, [x21, _BGX_GMP_PCS_MISCX_CTL@GOTPAGEOFF]
	ldr	w2, [x21]
	mov	x0, x19
	mov	x1, x20
	bl	_bgx_reg_read
Lloh41:
	adrp	x8, _PCS_MISC_CTL_DISP_EN@GOTPAGE
Lloh42:
	ldr	x8, [x8, _PCS_MISC_CTL_DISP_EN@GOTPAGEOFF]
Lloh43:
	ldr	w8, [x8]
	bic	w3, w0, w8
	ldr	w2, [x21]
	mov	x0, x19
	mov	x1, x20
	bl	_bgx_reg_write
	b	LBB0_15
LBB0_11:
Lloh44:
	adrp	x9, _BGX_MODE_SGMII@GOTPAGE
Lloh45:
	ldr	x9, [x9, _BGX_MODE_SGMII@GOTPAGEOFF]
Lloh46:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_15
; %bb.12:
	ldr	x8, [x21, #16]
	cbz	x8, LBB0_15
; %bb.13:
Lloh47:
	adrp	x8, _BGX_GMP_PCS_MRX_STATUS@GOTPAGE
Lloh48:
	ldr	x8, [x8, _BGX_GMP_PCS_MRX_STATUS@GOTPAGEOFF]
Lloh49:
	ldr	w2, [x8]
Lloh50:
	adrp	x8, _PCS_MRX_STATUS_AN_CPT@GOTPAGE
Lloh51:
	ldr	x8, [x8, _PCS_MRX_STATUS_AN_CPT@GOTPAGEOFF]
Lloh52:
	ldr	w3, [x8]
	mov	x0, x19
	mov	x1, x20
	mov	w4, #0
	bl	_bgx_poll_reg
	cbz	x0, LBB0_16
; %bb.14:
	ldr	x0, [x19]
Lloh53:
	adrp	x1, l_.str.1@PAGE
Lloh54:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_4
LBB0_15:
	mov	w0, #0
LBB0_16:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpAdd	Lloh53, Lloh54
	.cfi_endproc
                                        ; -- End function
	.comm	_BGX_GMP_GMI_TXX_THRESH,4,2     ; @BGX_GMP_GMI_TXX_THRESH
	.comm	_BGX_GMP_GMI_RXX_JABBER,4,2     ; @BGX_GMP_GMI_RXX_JABBER
	.comm	_MAX_FRAME_SIZE,4,2             ; @MAX_FRAME_SIZE
	.comm	_BGX_GMP_GMI_TXX_APPEND,4,2     ; @BGX_GMP_GMI_TXX_APPEND
	.comm	_BGX_GMP_GMI_TXX_SGMII_CTL,4,2  ; @BGX_GMP_GMI_TXX_SGMII_CTL
	.comm	_BGX_CMRX_CFG,4,2               ; @BGX_CMRX_CFG
	.comm	_CMR_EN,4,2                     ; @CMR_EN
	.comm	_BGX_GMP_PCS_MRX_CTL,4,2        ; @BGX_GMP_PCS_MRX_CTL
	.comm	_PCS_MRX_CTL_RESET,4,2          ; @PCS_MRX_CTL_RESET
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"BGX PCS reset not completed\n"

	.comm	_PCS_MRX_CTL_PWR_DN,4,2         ; @PCS_MRX_CTL_PWR_DN
	.comm	_PCS_MRX_CTL_RST_AN,4,2         ; @PCS_MRX_CTL_RST_AN
	.comm	_PCS_MRX_CTL_AN_EN,4,2          ; @PCS_MRX_CTL_AN_EN
	.comm	_BGX_MODE_QSGMII,8,3            ; @BGX_MODE_QSGMII
	.comm	_BGX_GMP_PCS_MISCX_CTL,4,2      ; @BGX_GMP_PCS_MISCX_CTL
	.comm	_PCS_MISC_CTL_DISP_EN,4,2       ; @PCS_MISC_CTL_DISP_EN
	.comm	_BGX_MODE_SGMII,8,3             ; @BGX_MODE_SGMII
	.comm	_BGX_GMP_PCS_MRX_STATUS,4,2     ; @BGX_GMP_PCS_MRX_STATUS
	.comm	_PCS_MRX_STATUS_AN_CPT,4,2      ; @PCS_MRX_STATUS_AN_CPT
l_.str.1:                               ; @.str.1
	.asciz	"BGX AN_CPT not completed\n"

	.no_dead_strip	_bgx_lmac_sgmii_init
.subsections_via_symbols
