	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atl1c_reset_mac
_atl1c_reset_mac:                       ## @atl1c_reset_mac
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	8(%rdi), %rax
	movq	(%rax), %r14
	movl	$0, -28(%rbp)
	callq	_atl1c_stop_mac
	movq	_REG_MASTER_CTRL@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	leaq	-28(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_AT_READ_REG
	movq	_MASTER_CTRL_OOB_DIS@GOTPCREL(%rip), %rax
	movl	-28(%rbp), %edx
	orl	(%rax), %edx
	movl	%edx, -28(%rbp)
	movl	(%r15), %esi
	movq	_MASTER_CTRL_SOFT_RST@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_AT_WRITE_REG
	movq	%rbx, %rdi
	callq	_AT_WRITE_FLUSH
	movl	$10, %edi
	callq	_msleep
	movq	_IDLE_STATUS_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_atl1c_wait_until_idle
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	movl	$-1, %r14d
	jmp	LBB0_8
LBB0_2:
	movl	(%r15), %esi
	movl	-28(%rbp), %edx
	movq	%rbx, %rdi
	callq	_AT_WRITE_REG
	movq	_REG_MAC_CTRL@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	leaq	-28(%rbp), %r14
	movq	%rbx, %rdi
	movq	%r14, %rdx
	callq	_AT_READ_REG
	movl	(%r15), %esi
	movq	_MAC_CTRL_SPEED_MODE_SW@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	orl	-28(%rbp), %edx
	movq	%rbx, %rdi
	callq	_AT_WRITE_REG
	movq	_REG_SERDES@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%rbx, %rdi
	movq	%r14, %rdx
	callq	_AT_READ_REG
	movl	(%rbx), %eax
	xorl	%r14d, %r14d
	cmpl	$128, %eax
	je	LBB0_6
## %bb.3:
	cmpl	$130, %eax
	je	LBB0_6
## %bb.4:
	cmpl	$129, %eax
	jne	LBB0_8
## %bb.5:
	movq	_SERDES_PHY_CLK_SLOWDOWN@GOTPCREL(%rip), %rax
	movq	_SERDES_MAC_CLK_SLOWDOWN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	notl	%edx
	andl	-28(%rbp), %edx
	jmp	LBB0_7
LBB0_6:
	movq	_SERDES_PHY_CLK_SLOWDOWN@GOTPCREL(%rip), %rax
	movq	_SERDES_MAC_CLK_SLOWDOWN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	orl	-28(%rbp), %edx
LBB0_7:
	movl	%edx, -28(%rbp)
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_AT_WRITE_REG
LBB0_8:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_REG_MASTER_CTRL,4,2            ## @REG_MASTER_CTRL
	.comm	_MASTER_CTRL_OOB_DIS,4,2        ## @MASTER_CTRL_OOB_DIS
	.comm	_MASTER_CTRL_SOFT_RST,4,2       ## @MASTER_CTRL_SOFT_RST
	.comm	_IDLE_STATUS_MASK,4,2           ## @IDLE_STATUS_MASK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"MAC state machine can't be idle since disabled for 10ms second\n"

	.comm	_REG_MAC_CTRL,4,2               ## @REG_MAC_CTRL
	.comm	_MAC_CTRL_SPEED_MODE_SW,4,2     ## @MAC_CTRL_SPEED_MODE_SW
	.comm	_REG_SERDES,4,2                 ## @REG_SERDES
	.comm	_SERDES_PHY_CLK_SLOWDOWN,4,2    ## @SERDES_PHY_CLK_SLOWDOWN
	.comm	_SERDES_MAC_CLK_SLOWDOWN,4,2    ## @SERDES_MAC_CLK_SLOWDOWN
	.no_dead_strip	_atl1c_reset_mac
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atl1c_reset_mac
_atl1c_reset_mac:                       ; @atl1c_reset_mac
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x8, [x0, #8]
	ldr	x20, [x8]
	str	wzr, [sp, #12]
	bl	_atl1c_stop_mac
Lloh0:
	adrp	x21, _REG_MASTER_CTRL@GOTPAGE
Lloh1:
	ldr	x21, [x21, _REG_MASTER_CTRL@GOTPAGEOFF]
	ldr	w1, [x21]
	add	x2, sp, #12
	mov	x0, x19
	bl	_AT_READ_REG
Lloh2:
	adrp	x8, _MASTER_CTRL_OOB_DIS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MASTER_CTRL_OOB_DIS@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	ldr	w9, [sp, #12]
	orr	w8, w9, w8
	str	w8, [sp, #12]
	ldr	w1, [x21]
Lloh5:
	adrp	x9, _MASTER_CTRL_SOFT_RST@GOTPAGE
Lloh6:
	ldr	x9, [x9, _MASTER_CTRL_SOFT_RST@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x19
	bl	_AT_WRITE_REG
	mov	x0, x19
	bl	_AT_WRITE_FLUSH
	mov	w0, #10
	bl	_msleep
Lloh8:
	adrp	x8, _IDLE_STATUS_MASK@GOTPAGE
Lloh9:
	ldr	x8, [x8, _IDLE_STATUS_MASK@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_atl1c_wait_until_idle
	cbz	x0, LBB0_2
; %bb.1:
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_err
	mov	w0, #-1
	b	LBB0_9
LBB0_2:
	ldr	w1, [x21]
	ldr	w2, [sp, #12]
	mov	x0, x19
	bl	_AT_WRITE_REG
Lloh13:
	adrp	x20, _REG_MAC_CTRL@GOTPAGE
Lloh14:
	ldr	x20, [x20, _REG_MAC_CTRL@GOTPAGEOFF]
	ldr	w1, [x20]
	add	x2, sp, #12
	mov	x0, x19
	bl	_AT_READ_REG
	ldr	w1, [x20]
	ldr	w8, [sp, #12]
Lloh15:
	adrp	x9, _MAC_CTRL_SPEED_MODE_SW@GOTPAGE
Lloh16:
	ldr	x9, [x9, _MAC_CTRL_SPEED_MODE_SW@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x19
	bl	_AT_WRITE_REG
Lloh18:
	adrp	x20, _REG_SERDES@GOTPAGE
Lloh19:
	ldr	x20, [x20, _REG_SERDES@GOTPAGEOFF]
	ldr	w1, [x20]
	add	x2, sp, #12
	mov	x0, x19
	bl	_AT_READ_REG
	ldr	w8, [x19]
	cmp	w8, #128
	b.eq	LBB0_6
; %bb.3:
	cmp	w8, #130
	b.eq	LBB0_6
; %bb.4:
	cmp	w8, #129
	b.ne	LBB0_8
; %bb.5:
Lloh20:
	adrp	x8, _SERDES_PHY_CLK_SLOWDOWN@GOTPAGE
Lloh21:
	ldr	x8, [x8, _SERDES_PHY_CLK_SLOWDOWN@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
Lloh23:
	adrp	x9, _SERDES_MAC_CLK_SLOWDOWN@GOTPAGE
Lloh24:
	ldr	x9, [x9, _SERDES_MAC_CLK_SLOWDOWN@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	w9, [sp, #12]
	bic	w2, w9, w8
	b	LBB0_7
LBB0_6:
Lloh26:
	adrp	x8, _SERDES_PHY_CLK_SLOWDOWN@GOTPAGE
Lloh27:
	ldr	x8, [x8, _SERDES_PHY_CLK_SLOWDOWN@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
Lloh29:
	adrp	x9, _SERDES_MAC_CLK_SLOWDOWN@GOTPAGE
Lloh30:
	ldr	x9, [x9, _SERDES_MAC_CLK_SLOWDOWN@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	w9, [sp, #12]
	orr	w2, w8, w9
LBB0_7:
	str	w2, [sp, #12]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_AT_WRITE_REG
LBB0_8:
	mov	w0, #0
LBB0_9:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_REG_MASTER_CTRL,4,2            ; @REG_MASTER_CTRL
	.comm	_MASTER_CTRL_OOB_DIS,4,2        ; @MASTER_CTRL_OOB_DIS
	.comm	_MASTER_CTRL_SOFT_RST,4,2       ; @MASTER_CTRL_SOFT_RST
	.comm	_IDLE_STATUS_MASK,4,2           ; @IDLE_STATUS_MASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"MAC state machine can't be idle since disabled for 10ms second\n"

	.comm	_REG_MAC_CTRL,4,2               ; @REG_MAC_CTRL
	.comm	_MAC_CTRL_SPEED_MODE_SW,4,2     ; @MAC_CTRL_SPEED_MODE_SW
	.comm	_REG_SERDES,4,2                 ; @REG_SERDES
	.comm	_SERDES_PHY_CLK_SLOWDOWN,4,2    ; @SERDES_PHY_CLK_SLOWDOWN
	.comm	_SERDES_MAC_CLK_SLOWDOWN,4,2    ; @SERDES_MAC_CLK_SLOWDOWN
	.no_dead_strip	_atl1c_reset_mac
.subsections_via_symbols
