	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xgene_sgmii_enable_autoneg
_xgene_sgmii_enable_autoneg:            ## @xgene_sgmii_enable_autoneg
	.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	_xgene_sgmii_configure
	movl	$-10, %ebx
	movq	_SGMII_STATUS_ADDR@GOTPCREL(%rip), %r13
	movq	_AUTO_NEG_COMPLETE@GOTPCREL(%rip), %r12
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	$1000, %edi                     ## imm = 0x3E8
	movl	$2000, %esi                     ## imm = 0x7D0
	callq	_usleep_range
	incl	%ebx
	je	LBB0_4
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	_INT_PHY_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r13), %edx
	sarl	$2, %edx
	movq	%r14, %rdi
	callq	_xgene_mii_phy_read
	movl	%eax, %r15d
	testl	%eax, (%r12)
	je	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	_LINK_STATUS@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_3
	jmp	LBB0_5
LBB0_4:
	testl	%r15d, (%r12)
	je	LBB0_7
LBB0_5:
	movq	_LINK_STATUS@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_7
## %bb.6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_netdev_err                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_INT_PHY_ADDR,4,2               ## @INT_PHY_ADDR
	.comm	_SGMII_STATUS_ADDR,4,2          ## @SGMII_STATUS_ADDR
	.comm	_AUTO_NEG_COMPLETE,4,2          ## @AUTO_NEG_COMPLETE
	.comm	_LINK_STATUS,4,2                ## @LINK_STATUS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Auto-negotiation failed\n"

	.no_dead_strip	_xgene_sgmii_enable_autoneg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xgene_sgmii_enable_autoneg
_xgene_sgmii_enable_autoneg:            ; @xgene_sgmii_enable_autoneg
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
	bl	_xgene_sgmii_configure
	mov	w21, #-10
Lloh0:
	adrp	x23, _INT_PHY_ADDR@GOTPAGE
Lloh1:
	ldr	x23, [x23, _INT_PHY_ADDR@GOTPAGEOFF]
Lloh2:
	adrp	x25, _SGMII_STATUS_ADDR@GOTPAGE
Lloh3:
	ldr	x25, [x25, _SGMII_STATUS_ADDR@GOTPAGEOFF]
Lloh4:
	adrp	x24, _AUTO_NEG_COMPLETE@GOTPAGE
Lloh5:
	ldr	x24, [x24, _AUTO_NEG_COMPLETE@GOTPAGEOFF]
Lloh6:
	adrp	x22, _LINK_STATUS@GOTPAGE
Lloh7:
	ldr	x22, [x22, _LINK_STATUS@GOTPAGEOFF]
	b	LBB0_2
LBB0_1:                                 ;   in Loop: Header=BB0_2 Depth=1
	mov	w0, #1000
	mov	w1, #2000
	bl	_usleep_range
	adds	w21, w21, #1
	b.hs	LBB0_4
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x23]
	ldr	w8, [x25]
	asr	w2, w8, #2
	mov	x0, x19
	bl	_xgene_mii_phy_read
	mov	x20, x0
	ldr	w8, [x24]
	tst	w8, w0
	b.eq	LBB0_1
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w8, [x22]
	tst	w8, w20
	b.eq	LBB0_1
	b	LBB0_5
LBB0_4:
	ldr	w8, [x24]
	tst	w8, w20
	b.eq	LBB0_7
LBB0_5:
	ldr	w8, [x22]
	tst	w8, w20
	b.eq	LBB0_7
; %bb.6:
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_7:
	ldr	w0, [x19]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_netdev_err
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_INT_PHY_ADDR,4,2               ; @INT_PHY_ADDR
	.comm	_SGMII_STATUS_ADDR,4,2          ; @SGMII_STATUS_ADDR
	.comm	_AUTO_NEG_COMPLETE,4,2          ; @AUTO_NEG_COMPLETE
	.comm	_LINK_STATUS,4,2                ; @LINK_STATUS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Auto-negotiation failed\n"

	.no_dead_strip	_xgene_sgmii_enable_autoneg
.subsections_via_symbols
