	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bgx_poll_for_sgmii_link
_bgx_poll_for_sgmii_link:               ## @bgx_poll_for_sgmii_link
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movl	32(%rdi), %esi
	movl	36(%rdi), %edi
	movq	_BGX_GMP_PCS_MRX_STATUS@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	callq	_bgx_reg_read
	movl	%eax, %r14d
	movq	_PCS_MRX_STATUS_LINK@GOTPCREL(%rip), %r15
	testl	%eax, (%r15)
	jne	LBB0_2
## %bb.1:
	movl	32(%rbx), %esi
	movl	36(%rbx), %edi
	movl	(%r12), %edx
	callq	_bgx_reg_read
	movl	%eax, %r14d
LBB0_2:
	movl	32(%rbx), %esi
	movl	36(%rbx), %edi
	movl	(%r12), %edx
	movq	_PCS_MRX_STATUS_AN_CPT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%r8d, %r8d
	callq	_bgx_poll_reg
	testq	%rax, %rax
	je	LBB0_3
LBB0_10:
	movl	$0, (%rbx)
	movq	_SPEED_UNKNOWN@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 24(%rbx)
	movq	_DUPLEX_UNKNOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%rbx)
	jmp	LBB0_11
LBB0_3:
	xorl	%eax, %eax
	andl	(%r15), %r14d
	setne	%al
	movl	%eax, (%rbx)
	movl	32(%rbx), %esi
	movl	36(%rbx), %edi
	movq	_BGX_GMP_PCS_ANX_AN_RESULTS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_bgx_reg_read
	movl	%eax, %ecx
	shrl	$3, %ecx
	andl	$3, %ecx
	shrl	%eax
	andl	$1, %eax
	movl	%eax, 4(%rbx)
	cmpl	$2, %ecx
	je	LBB0_9
## %bb.4:
	cmpl	$1, %ecx
	je	LBB0_8
## %bb.5:
	testl	%ecx, %ecx
	jne	LBB0_10
## %bb.6:
	movq	_SPEED_10@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_9:
	movq	_SPEED_1000@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_8:
	movq	_SPEED_100@GOTPCREL(%rip), %rax
LBB0_7:
	movq	(%rax), %rax
	movq	%rax, 24(%rbx)
LBB0_11:
	movl	(%rbx), %eax
	cmpl	%eax, 8(%rbx)
	je	LBB0_16
## %bb.12:
	testl	%eax, %eax
	je	LBB0_13
## %bb.14:
	movq	%rbx, %rdi
	callq	_bgx_sgmii_change_link_state
	movl	(%rbx), %eax
	jmp	LBB0_15
LBB0_13:
	xorl	%eax, %eax
LBB0_15:
	movl	%eax, 8(%rbx)
LBB0_16:
	movl	16(%rbx), %edi
	addq	$12, %rbx
	movq	_HZ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leal	(%rax,%rax,2), %edx
	movq	%rbx, %rsi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_queue_delayed_work             ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_BGX_GMP_PCS_MRX_STATUS,4,2     ## @BGX_GMP_PCS_MRX_STATUS
	.comm	_PCS_MRX_STATUS_LINK,4,2        ## @PCS_MRX_STATUS_LINK
	.comm	_PCS_MRX_STATUS_AN_CPT,4,2      ## @PCS_MRX_STATUS_AN_CPT
	.comm	_SPEED_UNKNOWN,8,3              ## @SPEED_UNKNOWN
	.comm	_DUPLEX_UNKNOWN,8,3             ## @DUPLEX_UNKNOWN
	.comm	_BGX_GMP_PCS_ANX_AN_RESULTS,4,2 ## @BGX_GMP_PCS_ANX_AN_RESULTS
	.comm	_SPEED_10,8,3                   ## @SPEED_10
	.comm	_SPEED_100,8,3                  ## @SPEED_100
	.comm	_SPEED_1000,8,3                 ## @SPEED_1000
	.comm	_HZ,4,2                         ## @HZ
	.no_dead_strip	_bgx_poll_for_sgmii_link
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bgx_poll_for_sgmii_link
_bgx_poll_for_sgmii_link:               ; @bgx_poll_for_sgmii_link
	.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
	ldr	w0, [x0, #36]
	ldr	w1, [x19, #32]
Lloh0:
	adrp	x22, _BGX_GMP_PCS_MRX_STATUS@GOTPAGE
Lloh1:
	ldr	x22, [x22, _BGX_GMP_PCS_MRX_STATUS@GOTPAGEOFF]
	ldr	w2, [x22]
	bl	_bgx_reg_read
	mov	x20, x0
Lloh2:
	adrp	x21, _PCS_MRX_STATUS_LINK@GOTPAGE
Lloh3:
	ldr	x21, [x21, _PCS_MRX_STATUS_LINK@GOTPAGEOFF]
	ldr	w8, [x21]
	tst	w8, w0
	b.ne	LBB0_2
; %bb.1:
	ldp	w1, w0, [x19, #32]
	ldr	w2, [x22]
	bl	_bgx_reg_read
	mov	x20, x0
LBB0_2:
	ldp	w1, w0, [x19, #32]
	ldr	w2, [x22]
Lloh4:
	adrp	x8, _PCS_MRX_STATUS_AN_CPT@GOTPAGE
Lloh5:
	ldr	x8, [x8, _PCS_MRX_STATUS_AN_CPT@GOTPAGEOFF]
Lloh6:
	ldr	w3, [x8]
	mov	w4, #0
	bl	_bgx_poll_reg
	cbz	x0, LBB0_4
LBB0_3:
Lloh7:
	adrp	x8, _SPEED_UNKNOWN@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SPEED_UNKNOWN@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	str	x8, [x19, #24]
Lloh10:
	adrp	x8, _DUPLEX_UNKNOWN@GOTPAGE
Lloh11:
	ldr	x8, [x8, _DUPLEX_UNKNOWN@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	stp	wzr, w8, [x19]
	b	LBB0_11
LBB0_4:
	ldr	w8, [x21]
	tst	w8, w20
	cset	w8, ne
	str	w8, [x19]
	ldp	w1, w0, [x19, #32]
Lloh13:
	adrp	x8, _BGX_GMP_PCS_ANX_AN_RESULTS@GOTPAGE
Lloh14:
	ldr	x8, [x8, _BGX_GMP_PCS_ANX_AN_RESULTS@GOTPAGEOFF]
Lloh15:
	ldr	w2, [x8]
	bl	_bgx_reg_read
	ubfx	w8, w0, #3, #2
	ubfx	w9, w0, #1, #1
	str	w9, [x19, #4]
	cmp	w8, #2
	b.eq	LBB0_8
; %bb.5:
	cmp	w8, #1
	b.eq	LBB0_9
; %bb.6:
	cbnz	w8, LBB0_3
; %bb.7:
Lloh16:
	adrp	x8, _SPEED_10@GOTPAGE
Lloh17:
	ldr	x8, [x8, _SPEED_10@GOTPAGEOFF]
	b	LBB0_10
LBB0_8:
Lloh18:
	adrp	x8, _SPEED_1000@GOTPAGE
Lloh19:
	ldr	x8, [x8, _SPEED_1000@GOTPAGEOFF]
	b	LBB0_10
LBB0_9:
Lloh20:
	adrp	x8, _SPEED_100@GOTPAGE
Lloh21:
	ldr	x8, [x8, _SPEED_100@GOTPAGEOFF]
LBB0_10:
	ldr	x8, [x8]
	str	x8, [x19, #24]
LBB0_11:
	ldr	w9, [x19, #8]
	ldr	w8, [x19]
	cmp	w9, w8
	b.eq	LBB0_15
; %bb.12:
	cbz	w8, LBB0_14
; %bb.13:
	mov	x0, x19
	bl	_bgx_sgmii_change_link_state
	ldr	w8, [x19]
LBB0_14:
	str	w8, [x19, #8]
LBB0_15:
	ldr	w0, [x19, #16]
Lloh22:
	adrp	x8, _HZ@GOTPAGE
Lloh23:
	ldr	x8, [x8, _HZ@GOTPAGEOFF]
	add	x1, x19, #12
Lloh24:
	ldr	w8, [x8]
	add	w2, w8, w8, lsl #1
	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
	b	_queue_delayed_work
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_BGX_GMP_PCS_MRX_STATUS,4,2     ; @BGX_GMP_PCS_MRX_STATUS
	.comm	_PCS_MRX_STATUS_LINK,4,2        ; @PCS_MRX_STATUS_LINK
	.comm	_PCS_MRX_STATUS_AN_CPT,4,2      ; @PCS_MRX_STATUS_AN_CPT
	.comm	_SPEED_UNKNOWN,8,3              ; @SPEED_UNKNOWN
	.comm	_DUPLEX_UNKNOWN,8,3             ; @DUPLEX_UNKNOWN
	.comm	_BGX_GMP_PCS_ANX_AN_RESULTS,4,2 ; @BGX_GMP_PCS_ANX_AN_RESULTS
	.comm	_SPEED_10,8,3                   ; @SPEED_10
	.comm	_SPEED_100,8,3                  ; @SPEED_100
	.comm	_SPEED_1000,8,3                 ; @SPEED_1000
	.comm	_HZ,4,2                         ; @HZ
	.no_dead_strip	_bgx_poll_for_sgmii_link
.subsections_via_symbols
