	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_atl1c_phy_to_ps_link           ## -- Begin function atl1c_phy_to_ps_link
	.p2align	4, 0x90
_atl1c_phy_to_ps_link:                  ## @atl1c_phy_to_ps_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	8(%rdi), %r13
	movq	8(%r13), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	_ADVERTISED_10baseT_Half@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	_SPEED_0@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)
	movq	_FULL_DUPLEX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	movq	_MII_BMSR@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	leaq	-56(%rbp), %r15
	movq	%r15, %rdx
	callq	_atl1c_read_phy_reg
	movl	(%r14), %esi
	movq	%rbx, %rdi
	movq	%r15, %rdx
	callq	_atl1c_read_phy_reg
	movq	_BMSR_LSTATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -56(%rbp)
	je	LBB0_3
## %bb.1:
	movq	_MII_LPA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-60(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_atl1c_read_phy_reg
	movl	-60(%rbp), %eax
	movq	_LPA_10FULL@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_4
## %bb.2:
	movq	_ADVERTISED_10baseT_Full@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_3:
	movq	_SPEED_10@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)
	movq	_HALF_DUPLEX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	xorl	%eax, %eax
	jmp	LBB0_24
LBB0_4:
	movq	_LPA_10HALF@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_6
## %bb.5:
	movq	_ADVERTISED_10baseT_Half@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_6:
	movq	_LPA_100HALF@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_8
## %bb.7:
	movq	_ADVERTISED_100baseT_Half@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_8:
	movq	_LPA_100FULL@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_11
## %bb.9:
	movq	_ADVERTISED_100baseT_Full@GOTPCREL(%rip), %rax
LBB0_10:
	movl	(%rax), %r12d
LBB0_11:
	movl	(%rbx), %r15d
	movl	$0, 4(%rbx)
	movl	%r12d, (%rbx)
	movq	%rbx, %rdi
	callq	_atl1c_restart_autoneg
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	leaq	L_.str(%rip), %rsi
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_dev_dbg
	movl	$-1, %eax
	jmp	LBB0_14
LBB0_13:
	xorl	%eax, %eax
LBB0_14:
	movl	%r15d, (%rbx)
	cmpl	$0, -60(%rbp)
	je	LBB0_24
## %bb.15:
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	movq	_AT_SUSPEND_LINK_TIMEOUT@GOTPCREL(%rip), %r13
	cmpl	$0, (%r13)
	jle	LBB0_22
## %bb.16:
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	xorl	%r15d, %r15d
	leaq	-56(%rbp), %r12
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movl	$100, %edi
	callq	_mdelay
	movl	(%r14), %esi
	movq	%rbx, %rdi
	movq	%r12, %rdx
	callq	_atl1c_read_phy_reg
	movl	(%r14), %esi
	movq	%rbx, %rdi
	movq	%r12, %rdx
	callq	_atl1c_read_phy_reg
	movq	_BMSR_LSTATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -56(%rbp)
	jne	LBB0_20
## %bb.18:                              ##   in Loop: Header=BB0_17 Depth=1
	incl	%r15d
	cmpl	(%r13), %r15d
	jl	LBB0_17
## %bb.19:
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	jmp	LBB0_23
LBB0_20:
	leaq	-52(%rbp), %rsi
	leaq	-48(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_atl1c_get_speed_and_duplex
	testq	%rax, %rax
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	je	LBB0_23
## %bb.21:
	leaq	L_.str.1(%rip), %rsi
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_dev_dbg
LBB0_23:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	jmp	LBB0_24
LBB0_22:
	movq	-72(%rbp), %r13                 ## 8-byte Reload
LBB0_24:
	movl	-52(%rbp), %ecx
	movl	%ecx, (%r13)
	movl	-48(%rbp), %ecx
	movl	%ecx, 4(%r13)
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ADVERTISED_10baseT_Half,4,2    ## @ADVERTISED_10baseT_Half
	.comm	_SPEED_0,4,2                    ## @SPEED_0
	.comm	_FULL_DUPLEX,4,2                ## @FULL_DUPLEX
	.comm	_MII_BMSR,4,2                   ## @MII_BMSR
	.comm	_BMSR_LSTATUS,4,2               ## @BMSR_LSTATUS
	.comm	_MII_LPA,4,2                    ## @MII_LPA
	.comm	_LPA_10FULL,4,2                 ## @LPA_10FULL
	.comm	_ADVERTISED_10baseT_Full,4,2    ## @ADVERTISED_10baseT_Full
	.comm	_LPA_10HALF,4,2                 ## @LPA_10HALF
	.comm	_LPA_100HALF,4,2                ## @LPA_100HALF
	.comm	_ADVERTISED_100baseT_Half,4,2   ## @ADVERTISED_100baseT_Half
	.comm	_LPA_100FULL,4,2                ## @LPA_100FULL
	.comm	_ADVERTISED_100baseT_Full,4,2   ## @ADVERTISED_100baseT_Full
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"phy autoneg failed\n"

	.comm	_AT_SUSPEND_LINK_TIMEOUT,4,2    ## @AT_SUSPEND_LINK_TIMEOUT
L_.str.1:                               ## @.str.1
	.asciz	"get speed and duplex failed\n"

	.comm	_SPEED_10,4,2                   ## @SPEED_10
	.comm	_HALF_DUPLEX,4,2                ## @HALF_DUPLEX
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_atl1c_phy_to_ps_link           ; -- Begin function atl1c_phy_to_ps_link
	.p2align	2
_atl1c_phy_to_ps_link:                  ; @atl1c_phy_to_ps_link
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x20, x0
	ldr	x22, [x0, #8]
	ldr	x19, [x22, #8]
Lloh0:
	adrp	x25, _ADVERTISED_10baseT_Half@GOTPAGE
Lloh1:
	ldr	x25, [x25, _ADVERTISED_10baseT_Half@GOTPAGEOFF]
	ldr	w21, [x25]
Lloh2:
	adrp	x8, _SPEED_0@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SPEED_0@GOTPAGEOFF]
Lloh4:
	ldr	w10, [x8]
Lloh5:
	adrp	x9, _FULL_DUPLEX@GOTPAGE
Lloh6:
	ldr	x9, [x9, _FULL_DUPLEX@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x9]
	stp	w8, w10, [sp]
Lloh8:
	adrp	x23, _MII_BMSR@GOTPAGE
Lloh9:
	ldr	x23, [x23, _MII_BMSR@GOTPAGEOFF]
	ldr	w1, [x23]
	add	x2, sp, #12
	bl	_atl1c_read_phy_reg
	ldr	w1, [x23]
	add	x2, sp, #12
	mov	x0, x20
	bl	_atl1c_read_phy_reg
	ldr	w8, [sp, #12]
Lloh10:
	adrp	x24, _BMSR_LSTATUS@GOTPAGE
Lloh11:
	ldr	x24, [x24, _BMSR_LSTATUS@GOTPAGEOFF]
	ldr	w9, [x24]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.1:
Lloh12:
	adrp	x8, _MII_LPA@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MII_LPA@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x20
	bl	_atl1c_read_phy_reg
	ldr	w8, [sp, #8]
Lloh15:
	adrp	x9, _LPA_10FULL@GOTPAGE
Lloh16:
	ldr	x9, [x9, _LPA_10FULL@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.2:
Lloh18:
	adrp	x8, _ADVERTISED_10baseT_Full@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ADVERTISED_10baseT_Full@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	b	LBB0_9
LBB0_3:
	mov	w21, #0
Lloh21:
	adrp	x8, _SPEED_10@GOTPAGE
Lloh22:
	ldr	x8, [x8, _SPEED_10@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	str	w8, [sp, #4]
Lloh24:
	adrp	x8, _HALF_DUPLEX@GOTPAGE
Lloh25:
	ldr	x8, [x8, _HALF_DUPLEX@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	str	w8, [sp]
	b	LBB0_19
LBB0_4:
Lloh27:
	adrp	x9, _LPA_10HALF@GOTPAGE
Lloh28:
	ldr	x9, [x9, _LPA_10HALF@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.5:
	ldr	w8, [x25]
	b	LBB0_9
LBB0_6:
Lloh30:
	adrp	x9, _LPA_100HALF@GOTPAGE
Lloh31:
	ldr	x9, [x9, _LPA_100HALF@GOTPAGEOFF]
Lloh32:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.7:
Lloh33:
	adrp	x8, _ADVERTISED_100baseT_Half@GOTPAGE
Lloh34:
	ldr	x8, [x8, _ADVERTISED_100baseT_Half@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	b	LBB0_9
LBB0_8:
Lloh36:
	adrp	x9, _LPA_100FULL@GOTPAGE
Lloh37:
	ldr	x9, [x9, _LPA_100FULL@GOTPAGEOFF]
Lloh38:
	ldr	w9, [x9]
Lloh39:
	adrp	x10, _ADVERTISED_100baseT_Full@GOTPAGE
Lloh40:
	ldr	x10, [x10, _ADVERTISED_100baseT_Full@GOTPAGEOFF]
Lloh41:
	ldr	w10, [x10]
	tst	w9, w8
	csel	w8, w21, w10, eq
LBB0_9:
	ldr	w25, [x20]
	stp	w8, wzr, [x20]
	mov	x0, x20
	bl	_atl1c_restart_autoneg
	cbz	x0, LBB0_11
; %bb.10:
Lloh42:
	adrp	x1, l_.str@PAGE
Lloh43:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
	mov	w21, #-1
	b	LBB0_12
LBB0_11:
	mov	w21, #0
LBB0_12:
	str	w25, [x20]
	ldr	w8, [sp, #8]
	cbz	w8, LBB0_19
; %bb.13:
Lloh44:
	adrp	x25, _AT_SUSPEND_LINK_TIMEOUT@GOTPAGE
Lloh45:
	ldr	x25, [x25, _AT_SUSPEND_LINK_TIMEOUT@GOTPAGEOFF]
	ldr	w8, [x25]
	cmp	w8, #1
	b.lt	LBB0_19
; %bb.14:
	mov	w26, #0
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	mov	w0, #100
	bl	_mdelay
	ldr	w1, [x23]
	add	x2, sp, #12
	mov	x0, x20
	bl	_atl1c_read_phy_reg
	ldr	w1, [x23]
	add	x2, sp, #12
	mov	x0, x20
	bl	_atl1c_read_phy_reg
	ldr	w8, [sp, #12]
	ldr	w9, [x24]
	tst	w9, w8
	b.ne	LBB0_17
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	add	w26, w26, #1
	ldr	w8, [x25]
	cmp	w26, w8
	b.lt	LBB0_15
	b	LBB0_19
LBB0_17:
	add	x1, sp, #4
	mov	x2, sp
	mov	x0, x20
	bl	_atl1c_get_speed_and_duplex
	cbz	x0, LBB0_19
; %bb.18:
Lloh46:
	adrp	x1, l_.str.1@PAGE
Lloh47:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
LBB0_19:
	ldr	w8, [sp, #4]
	str	w8, [x22]
	ldr	w8, [sp]
	str	w8, [x22, #4]
	mov	x0, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpLdrGot	Lloh44, Lloh45
	.loh AdrpAdd	Lloh46, Lloh47
	.cfi_endproc
                                        ; -- End function
	.comm	_ADVERTISED_10baseT_Half,4,2    ; @ADVERTISED_10baseT_Half
	.comm	_SPEED_0,4,2                    ; @SPEED_0
	.comm	_FULL_DUPLEX,4,2                ; @FULL_DUPLEX
	.comm	_MII_BMSR,4,2                   ; @MII_BMSR
	.comm	_BMSR_LSTATUS,4,2               ; @BMSR_LSTATUS
	.comm	_MII_LPA,4,2                    ; @MII_LPA
	.comm	_LPA_10FULL,4,2                 ; @LPA_10FULL
	.comm	_ADVERTISED_10baseT_Full,4,2    ; @ADVERTISED_10baseT_Full
	.comm	_LPA_10HALF,4,2                 ; @LPA_10HALF
	.comm	_LPA_100HALF,4,2                ; @LPA_100HALF
	.comm	_ADVERTISED_100baseT_Half,4,2   ; @ADVERTISED_100baseT_Half
	.comm	_LPA_100FULL,4,2                ; @LPA_100FULL
	.comm	_ADVERTISED_100baseT_Full,4,2   ; @ADVERTISED_100baseT_Full
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"phy autoneg failed\n"

	.comm	_AT_SUSPEND_LINK_TIMEOUT,4,2    ; @AT_SUSPEND_LINK_TIMEOUT
l_.str.1:                               ; @.str.1
	.asciz	"get speed and duplex failed\n"

	.comm	_SPEED_10,4,2                   ; @SPEED_10
	.comm	_HALF_DUPLEX,4,2                ; @HALF_DUPLEX
.subsections_via_symbols
