	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atl1_phy_reset
_atl1_phy_reset:                        ## @atl1_phy_reset
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movq	16(%rdi), %r14
	movl	(%rdi), %eax
	movq	_MEDIA_TYPE_AUTO_SENSOR@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_6
## %bb.1:
	movq	_MEDIA_TYPE_1000M_FULL@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_6
## %bb.2:
	cmpl	$128, %eax
	je	LBB0_7
## %bb.3:
	cmpl	$129, %eax
	je	LBB0_9
## %bb.4:
	cmpl	$130, %eax
	jne	LBB0_10
## %bb.5:
	movq	_MII_CR_FULL_DUPLEX@GOTPCREL(%rip), %rax
	movq	_MII_CR_SPEED_100@GOTPCREL(%rip), %rcx
	jmp	LBB0_8
LBB0_6:
	movq	_MII_CR_AUTO_NEG_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_MII_CR_RESET@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_7:
	movq	_MII_CR_FULL_DUPLEX@GOTPCREL(%rip), %rax
	movq	_MII_CR_SPEED_10@GOTPCREL(%rip), %rcx
LBB0_8:
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	_MII_CR_RESET@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_9:
	movq	_MII_CR_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_MII_CR_SPEED_100@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_10:
	movq	_MII_CR_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_MII_CR_SPEED_10@GOTPCREL(%rip), %rax
LBB0_11:
	movq	(%r14), %rbx
	orl	(%rax), %edx
	movq	_MII_BMCR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_atl1_write_phy_reg
	testq	%rax, %rax
	je	LBB0_21
## %bb.12:
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	callq	_netif_msg_hw
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_dev_dbg
LBB0_14:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movl	$25, %ebx
	movq	_REG_MDIO_CTRL@GOTPCREL(%rip), %r12
	movq	_MDIO_START@GOTPCREL(%rip), %r14
	movq	_MDIO_BUSY@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movl	$1, %edi
	callq	_msleep
	movq	(%r12), %rdi
	addq	8(%r13), %rdi
	callq	_ioread32
	movl	(%r15), %ecx
	orl	(%r14), %ecx
	testl	%eax, %ecx
	je	LBB0_21
## %bb.16:                              ##   in Loop: Header=BB0_15 Depth=1
	decl	%ebx
	jne	LBB0_15
## %bb.17:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_netif_msg_hw
	testq	%rax, %rax
	je	LBB0_19
## %bb.18:
	leaq	L_.str.1(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_dev_warn
LBB0_19:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	jmp	LBB0_22
LBB0_21:
	xorl	%eax, %eax
LBB0_22:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MEDIA_TYPE_AUTO_SENSOR,4,2     ## @MEDIA_TYPE_AUTO_SENSOR
	.comm	_MEDIA_TYPE_1000M_FULL,4,2      ## @MEDIA_TYPE_1000M_FULL
	.comm	_MII_CR_RESET,4,2               ## @MII_CR_RESET
	.comm	_MII_CR_AUTO_NEG_EN,4,2         ## @MII_CR_AUTO_NEG_EN
	.comm	_MII_CR_FULL_DUPLEX,4,2         ## @MII_CR_FULL_DUPLEX
	.comm	_MII_CR_SPEED_100,4,2           ## @MII_CR_SPEED_100
	.comm	_MII_CR_SPEED_10,4,2            ## @MII_CR_SPEED_10
	.comm	_MII_BMCR,4,2                   ## @MII_BMCR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pcie phy link down\n"

	.comm	_REG_MDIO_CTRL,8,3              ## @REG_MDIO_CTRL
	.comm	_MDIO_START,4,2                 ## @MDIO_START
	.comm	_MDIO_BUSY,4,2                  ## @MDIO_BUSY
L_.str.1:                               ## @.str.1
	.asciz	"pcie link down at least 25ms\n"

	.no_dead_strip	_atl1_phy_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atl1_phy_reset
_atl1_phy_reset:                        ; @atl1_phy_reset
	.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	x20, x0
	ldr	x19, [x0, #16]
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _MEDIA_TYPE_AUTO_SENSOR@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MEDIA_TYPE_AUTO_SENSOR@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
Lloh3:
	adrp	x10, _MEDIA_TYPE_1000M_FULL@GOTPAGE
Lloh4:
	ldr	x10, [x10, _MEDIA_TYPE_1000M_FULL@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	cmp	w8, w9
	ccmp	w8, w10, #4, ne
	b.ne	LBB0_2
; %bb.1:
Lloh6:
	adrp	x8, _MII_CR_AUTO_NEG_EN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MII_CR_AUTO_NEG_EN@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	b	LBB0_8
LBB0_2:
	cmp	w8, #128
	b.eq	LBB0_6
; %bb.3:
	cmp	w8, #129
	b.eq	LBB0_19
; %bb.4:
	cmp	w8, #130
	b.ne	LBB0_20
; %bb.5:
Lloh9:
	adrp	x8, _MII_CR_FULL_DUPLEX@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MII_CR_FULL_DUPLEX@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _MII_CR_SPEED_100@GOTPAGE
Lloh13:
	ldr	x9, [x9, _MII_CR_SPEED_100@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
Lloh14:
	adrp	x8, _MII_CR_FULL_DUPLEX@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MII_CR_FULL_DUPLEX@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
Lloh17:
	adrp	x9, _MII_CR_SPEED_10@GOTPAGE
Lloh18:
	ldr	x9, [x9, _MII_CR_SPEED_10@GOTPAGEOFF]
LBB0_7:
	ldr	w9, [x9]
	orr	w8, w9, w8
LBB0_8:
Lloh19:
	adrp	x9, _MII_CR_RESET@GOTPAGE
Lloh20:
	ldr	x9, [x9, _MII_CR_RESET@GOTPAGEOFF]
LBB0_9:
	ldr	x22, [x19]
	ldr	w9, [x9]
	orr	w2, w8, w9
Lloh21:
	adrp	x8, _MII_BMCR@GOTPAGE
Lloh22:
	ldr	x8, [x8, _MII_BMCR@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_atl1_write_phy_reg
	mov	x21, x0
	cbz	x0, LBB0_18
; %bb.10:
	mov	x0, x19
	bl	_netif_msg_hw
	cbz	x0, LBB0_12
; %bb.11:
Lloh24:
	adrp	x1, l_.str@PAGE
Lloh25:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	bl	_dev_dbg
LBB0_12:
	mov	w23, #25
Lloh26:
	adrp	x24, _REG_MDIO_CTRL@GOTPAGE
Lloh27:
	ldr	x24, [x24, _REG_MDIO_CTRL@GOTPAGEOFF]
Lloh28:
	adrp	x25, _MDIO_START@GOTPAGE
Lloh29:
	ldr	x25, [x25, _MDIO_START@GOTPAGEOFF]
Lloh30:
	adrp	x26, _MDIO_BUSY@GOTPAGE
Lloh31:
	ldr	x26, [x26, _MDIO_BUSY@GOTPAGEOFF]
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	mov	w0, #1
	bl	_msleep
	ldr	x8, [x20, #8]
	ldr	x9, [x24]
	add	x0, x9, x8
	bl	_ioread32
	ldr	w8, [x25]
	ldr	w9, [x26]
	orr	w8, w9, w8
	tst	w8, w0
	b.eq	LBB0_17
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	subs	w23, w23, #1
	b.ne	LBB0_13
; %bb.15:
	mov	x0, x19
	bl	_netif_msg_hw
	cbz	x0, LBB0_18
; %bb.16:
Lloh32:
	adrp	x1, l_.str.1@PAGE
Lloh33:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x22
	bl	_dev_warn
	b	LBB0_18
LBB0_17:
	mov	x21, #0
LBB0_18:
	mov	x0, x21
	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_19:
Lloh34:
	adrp	x8, _MII_CR_RESET@GOTPAGE
Lloh35:
	ldr	x8, [x8, _MII_CR_RESET@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
Lloh37:
	adrp	x9, _MII_CR_SPEED_100@GOTPAGE
Lloh38:
	ldr	x9, [x9, _MII_CR_SPEED_100@GOTPAGEOFF]
	b	LBB0_9
LBB0_20:
Lloh39:
	adrp	x8, _MII_CR_RESET@GOTPAGE
Lloh40:
	ldr	x8, [x8, _MII_CR_RESET@GOTPAGEOFF]
Lloh41:
	ldr	w8, [x8]
Lloh42:
	adrp	x9, _MII_CR_SPEED_10@GOTPAGE
Lloh43:
	ldr	x9, [x9, _MII_CR_SPEED_10@GOTPAGEOFF]
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.comm	_MEDIA_TYPE_AUTO_SENSOR,4,2     ; @MEDIA_TYPE_AUTO_SENSOR
	.comm	_MEDIA_TYPE_1000M_FULL,4,2      ; @MEDIA_TYPE_1000M_FULL
	.comm	_MII_CR_RESET,4,2               ; @MII_CR_RESET
	.comm	_MII_CR_AUTO_NEG_EN,4,2         ; @MII_CR_AUTO_NEG_EN
	.comm	_MII_CR_FULL_DUPLEX,4,2         ; @MII_CR_FULL_DUPLEX
	.comm	_MII_CR_SPEED_100,4,2           ; @MII_CR_SPEED_100
	.comm	_MII_CR_SPEED_10,4,2            ; @MII_CR_SPEED_10
	.comm	_MII_BMCR,4,2                   ; @MII_BMCR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pcie phy link down\n"

	.comm	_REG_MDIO_CTRL,8,3              ; @REG_MDIO_CTRL
	.comm	_MDIO_START,4,2                 ; @MDIO_START
	.comm	_MDIO_BUSY,4,2                  ; @MDIO_BUSY
l_.str.1:                               ; @.str.1
	.asciz	"pcie link down at least 25ms\n"

	.no_dead_strip	_atl1_phy_reset
.subsections_via_symbols
