	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function init_sgmii_pcs
_init_sgmii_pcs:                        ## @init_sgmii_pcs
	.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, %r14
	callq	_netdev_priv
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	_PHY_INTERFACE_MODE_SGMII@GOTPCREL(%rip), %rcx
	xorl	%r15d, %r15d
	cmpq	(%rcx), %rax
	jne	LBB0_12
## %bb.1:
	xorl	%r15d, %r15d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_sgmii_pcs_scratch_test
	testq	%rax, %rax
	je	LBB0_13
## %bb.2:
	movq	%rbx, %rdi
	movl	$65535, %esi                    ## imm = 0xFFFF
	callq	_sgmii_pcs_scratch_test
	testq	%rax, %rax
	je	LBB0_13
## %bb.3:
	movq	%rbx, %rdi
	movl	$42405, %esi                    ## imm = 0xA5A5
	callq	_sgmii_pcs_scratch_test
	testq	%rax, %rax
	je	LBB0_13
## %bb.4:
	movq	%rbx, %rdi
	movl	$23130, %esi                    ## imm = 0x5A5A
	callq	_sgmii_pcs_scratch_test
	testq	%rax, %rax
	je	LBB0_13
## %bb.5:
	movq	_MII_PHYSID1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_sgmii_pcs_read
	movl	%eax, %r12d
	movq	_MII_PHYSID2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_sgmii_pcs_read
	leaq	L_.str(%rip), %rsi
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	movl	%r12d, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_netdev_info
	movq	_SGMII_PCS_LINK_TIMER_0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$3392, %edx                     ## imm = 0xD40
	callq	_sgmii_pcs_write
	movq	_SGMII_PCS_LINK_TIMER_1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$3, %edx
	callq	_sgmii_pcs_write
	movq	_SGMII_PCS_IF_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$3, %edx
	callq	_sgmii_pcs_write
	movq	_MII_BMCR@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%rbx, %rdi
	callq	_sgmii_pcs_read
	movl	%eax, %r12d
	movq	_BMCR_SPEED1000@GOTPCREL(%rip), %rax
	movq	_BMCR_FULLDPLX@GOTPCREL(%rip), %rcx
	orl	(%rax), %r12d
	orl	(%rcx), %r12d
	movq	_BMCR_ANENABLE@GOTPCREL(%rip), %rax
	orl	(%rax), %r12d
	movl	(%r13), %esi
	movq	%rbx, %rdi
	movl	%r12d, %edx
	callq	_sgmii_pcs_write
	movq	_BMCR_RESET@GOTPCREL(%rip), %rax
	orl	(%rax), %r12d
	movl	(%r13), %esi
	movq	%rbx, %rdi
	movl	%r12d, %edx
	callq	_sgmii_pcs_write
	movq	_SGMII_PCS_SW_RESET_TIMEOUT@GOTPCREL(%rip), %r12
	cmpl	$0, (%r12)
	jle	LBB0_10
## %bb.6:
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	_MII_BMCR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_sgmii_pcs_read
	movq	_BMCR_RESET@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movl	$1, %edi
	callq	_udelay
	incl	%r13d
	cmpl	(%r12), %r13d
	jl	LBB0_7
LBB0_10:
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	callq	_netdev_err
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_13:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_netdev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_11:
	subl	(%rax), %r15d
LBB0_12:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	leaq	L_.str.2(%rip), %rsi
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_netdev_info
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_PHY_INTERFACE_MODE_SGMII,8,3   ## @PHY_INTERFACE_MODE_SGMII
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"PCS PHY ID: 0x%04x%04x\n"

	.comm	_MII_PHYSID1,4,2                ## @MII_PHYSID1
	.comm	_MII_PHYSID2,4,2                ## @MII_PHYSID2
L_.str.1:                               ## @.str.1
	.asciz	"SGMII PCS Scratch memory test failed.\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_SGMII_PCS_LINK_TIMER_0,4,2     ## @SGMII_PCS_LINK_TIMER_0
	.comm	_SGMII_PCS_LINK_TIMER_1,4,2     ## @SGMII_PCS_LINK_TIMER_1
	.comm	_SGMII_PCS_IF_MODE,4,2          ## @SGMII_PCS_IF_MODE
	.comm	_MII_BMCR,4,2                   ## @MII_BMCR
	.comm	_BMCR_SPEED1000,4,2             ## @BMCR_SPEED1000
	.comm	_BMCR_FULLDPLX,4,2              ## @BMCR_FULLDPLX
	.comm	_BMCR_ANENABLE,4,2              ## @BMCR_ANENABLE
	.comm	_BMCR_RESET,4,2                 ## @BMCR_RESET
	.comm	_SGMII_PCS_SW_RESET_TIMEOUT,4,2 ## @SGMII_PCS_SW_RESET_TIMEOUT
L_.str.2:                               ## @.str.2
	.asciz	"SGMII PCS block initialised OK\n"

L_.str.3:                               ## @.str.3
	.asciz	"SGMII PCS block reset failed.\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	_init_sgmii_pcs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function init_sgmii_pcs
_init_sgmii_pcs:                        ; @init_sgmii_pcs
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x19, x0
	bl	_netdev_priv
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _PHY_INTERFACE_MODE_SGMII@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PHY_INTERFACE_MODE_SGMII@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.1:
	mov	x20, x0
	mov	w1, #0
	bl	_sgmii_pcs_scratch_test
	cbz	x0, LBB0_11
; %bb.2:
	mov	x0, x20
	mov	w1, #65535
	bl	_sgmii_pcs_scratch_test
	cbz	x0, LBB0_11
; %bb.3:
	mov	x0, x20
	mov	w1, #42405
	bl	_sgmii_pcs_scratch_test
	cbz	x0, LBB0_11
; %bb.4:
	mov	x0, x20
	mov	w1, #23130
	bl	_sgmii_pcs_scratch_test
	cbz	x0, LBB0_11
; %bb.5:
Lloh3:
	adrp	x8, _MII_PHYSID1@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MII_PHYSID1@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_sgmii_pcs_read
	mov	x21, x0
Lloh6:
	adrp	x8, _MII_PHYSID2@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MII_PHYSID2@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_sgmii_pcs_read
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x21, x0, [sp]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_netdev_info
Lloh11:
	adrp	x8, _SGMII_PCS_LINK_TIMER_0@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SGMII_PCS_LINK_TIMER_0@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #3392
	bl	_sgmii_pcs_write
Lloh14:
	adrp	x8, _SGMII_PCS_LINK_TIMER_1@GOTPAGE
Lloh15:
	ldr	x8, [x8, _SGMII_PCS_LINK_TIMER_1@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #3
	bl	_sgmii_pcs_write
Lloh17:
	adrp	x8, _SGMII_PCS_IF_MODE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SGMII_PCS_IF_MODE@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #3
	bl	_sgmii_pcs_write
Lloh20:
	adrp	x22, _MII_BMCR@GOTPAGE
Lloh21:
	ldr	x22, [x22, _MII_BMCR@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x20
	bl	_sgmii_pcs_read
Lloh22:
	adrp	x8, _BMCR_SPEED1000@GOTPAGE
Lloh23:
	ldr	x8, [x8, _BMCR_SPEED1000@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
Lloh25:
	adrp	x9, _BMCR_FULLDPLX@GOTPAGE
Lloh26:
	ldr	x9, [x9, _BMCR_FULLDPLX@GOTPAGEOFF]
Lloh27:
	adrp	x10, _BMCR_ANENABLE@GOTPAGE
Lloh28:
	ldr	x10, [x10, _BMCR_ANENABLE@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
Lloh30:
	ldr	w10, [x10]
	orr	w8, w8, w0
	orr	w8, w8, w9
	orr	w21, w8, w10
	ldr	w1, [x22]
	mov	x0, x20
	mov	x2, x21
	bl	_sgmii_pcs_write
Lloh31:
	adrp	x23, _BMCR_RESET@GOTPAGE
Lloh32:
	ldr	x23, [x23, _BMCR_RESET@GOTPAGEOFF]
	ldr	w8, [x23]
	orr	w2, w8, w21
	ldr	w1, [x22]
	mov	x0, x20
	bl	_sgmii_pcs_write
Lloh33:
	adrp	x21, _SGMII_PCS_SW_RESET_TIMEOUT@GOTPAGE
Lloh34:
	ldr	x21, [x21, _SGMII_PCS_SW_RESET_TIMEOUT@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.6:
	mov	w24, #0
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x22]
	mov	x0, x20
	bl	_sgmii_pcs_read
	ldr	w8, [x23]
	tst	w8, w0
	b.eq	LBB0_14
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	w0, #1
	bl	_udelay
	add	w24, w24, #1
	ldr	w8, [x21]
	cmp	w24, w8
	b.lt	LBB0_7
LBB0_9:
Lloh35:
	adrp	x1, l_.str.3@PAGE
Lloh36:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_netdev_err
Lloh37:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh38:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
	b	LBB0_12
LBB0_10:
	mov	w0, #0
	b	LBB0_13
LBB0_11:
Lloh39:
	adrp	x1, l_.str.1@PAGE
Lloh40:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_netdev_err
Lloh41:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh42:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_12:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_13:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_14:
Lloh43:
	adrp	x1, l_.str.2@PAGE
Lloh44:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_netdev_info
	mov	w0, #0
	b	LBB0_13
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh29
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh41, Lloh42
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpAdd	Lloh43, Lloh44
	.cfi_endproc
                                        ; -- End function
	.comm	_PHY_INTERFACE_MODE_SGMII,8,3   ; @PHY_INTERFACE_MODE_SGMII
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"PCS PHY ID: 0x%04x%04x\n"

	.comm	_MII_PHYSID1,4,2                ; @MII_PHYSID1
	.comm	_MII_PHYSID2,4,2                ; @MII_PHYSID2
l_.str.1:                               ; @.str.1
	.asciz	"SGMII PCS Scratch memory test failed.\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_SGMII_PCS_LINK_TIMER_0,4,2     ; @SGMII_PCS_LINK_TIMER_0
	.comm	_SGMII_PCS_LINK_TIMER_1,4,2     ; @SGMII_PCS_LINK_TIMER_1
	.comm	_SGMII_PCS_IF_MODE,4,2          ; @SGMII_PCS_IF_MODE
	.comm	_MII_BMCR,4,2                   ; @MII_BMCR
	.comm	_BMCR_SPEED1000,4,2             ; @BMCR_SPEED1000
	.comm	_BMCR_FULLDPLX,4,2              ; @BMCR_FULLDPLX
	.comm	_BMCR_ANENABLE,4,2              ; @BMCR_ANENABLE
	.comm	_BMCR_RESET,4,2                 ; @BMCR_RESET
	.comm	_SGMII_PCS_SW_RESET_TIMEOUT,4,2 ; @SGMII_PCS_SW_RESET_TIMEOUT
l_.str.2:                               ; @.str.2
	.asciz	"SGMII PCS block initialised OK\n"

l_.str.3:                               ; @.str.3
	.asciz	"SGMII PCS block reset failed.\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	_init_sgmii_pcs
.subsections_via_symbols
