	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function arc_emac_restart
_arc_emac_restart:                      ## @arc_emac_restart
	.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
	xorl	%eax, %eax
	callq	_net_ratelimit
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_netdev_warn
LBB0_2:
	movq	%r14, %rdi
	callq	_netif_stop_queue
	movq	_R_ENABLE@GOTPCREL(%rip), %rcx
	movq	_RXINT_MASK@GOTPCREL(%rip), %rax
	movq	_TXINT_MASK@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rax), %edx
	movl	(%rcx), %esi
	movq	_ERR_MASK@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_arc_reg_clr
	movq	_R_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_EN_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_arc_reg_clr
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	callq	_arc_free_tx_queue
	xorps	%xmm0, %xmm0
	movups	%xmm0, 24(%rbx)
	movl	16(%rbx), %edi
	movq	_TX_RING_SZ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	callq	_memset
	movq	_RX_BD_NUM@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_7
## %bb.3:
	xorl	%r12d, %r12d
	movq	_FOR_EMAC@GOTPCREL(%rip), %r15
	movq	_EMAC_BUFFER_SIZE@GOTPCREL(%rip), %r14
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	orl	(%r14), %edi
	callq	_cpu_to_le32
	movl	%eax, (%r13,%r12,4)
	incq	%r12
	movq	_RX_BD_NUM@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	cmpq	%rax, %r12
	jge	LBB0_7
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%rbx), %r13
	movl	(%r13,%r12,4), %edi
	callq	_le32_to_cpu
	movl	(%r15), %edi
	testl	%eax, %edi
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	incl	4(%rax)
	incl	(%rax)
	movl	(%r15), %edi
	jmp	LBB0_6
LBB0_7:
	movq	$0, (%rbx)
	xorl	%eax, %eax
	callq	_wmb
	movq	_R_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_TXINT_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_RXINT_MASK@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	_ERR_MASK@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_arc_reg_set
	movq	_R_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_EN_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_arc_reg_or
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_netif_start_queue              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"restarting stalled EMAC\n"

	.comm	_R_ENABLE,4,2                   ## @R_ENABLE
	.comm	_RXINT_MASK,4,2                 ## @RXINT_MASK
	.comm	_TXINT_MASK,4,2                 ## @TXINT_MASK
	.comm	_ERR_MASK,4,2                   ## @ERR_MASK
	.comm	_R_CTRL,4,2                     ## @R_CTRL
	.comm	_EN_MASK,4,2                    ## @EN_MASK
	.comm	_TX_RING_SZ,4,2                 ## @TX_RING_SZ
	.comm	_RX_BD_NUM,4,2                  ## @RX_BD_NUM
	.comm	_FOR_EMAC,4,2                   ## @FOR_EMAC
	.comm	_EMAC_BUFFER_SIZE,4,2           ## @EMAC_BUFFER_SIZE
	.no_dead_strip	_arc_emac_restart
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function arc_emac_restart
_arc_emac_restart:                      ; @arc_emac_restart
	.cfi_startproc
; %bb.0:
	stp	d9, d8, [sp, #-112]!            ; 16-byte Folded Spill
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	.cfi_offset b8, -104
	.cfi_offset b9, -112
	mov	x19, x0
	bl	_netdev_priv
	mov	x20, x0
	bl	_net_ratelimit
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_netdev_warn
LBB0_2:
	mov	x0, x19
	bl	_netif_stop_queue
Lloh2:
	adrp	x8, _R_ENABLE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _R_ENABLE@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
Lloh5:
	adrp	x8, _RXINT_MASK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _RXINT_MASK@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	adrp	x9, _TXINT_MASK@GOTPAGE
Lloh9:
	ldr	x9, [x9, _TXINT_MASK@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh11:
	adrp	x24, _ERR_MASK@GOTPAGE
Lloh12:
	ldr	x24, [x24, _ERR_MASK@GOTPAGEOFF]
	ldr	w9, [x24]
	orr	w2, w8, w9
	mov	x0, x20
	bl	_arc_reg_clr
Lloh13:
	adrp	x25, _R_CTRL@GOTPAGE
Lloh14:
	ldr	x25, [x25, _R_CTRL@GOTPAGEOFF]
	ldr	w1, [x25]
Lloh15:
	adrp	x26, _EN_MASK@GOTPAGE
Lloh16:
	ldr	x26, [x26, _EN_MASK@GOTPAGEOFF]
	ldr	w2, [x26]
	mov	x0, x20
	bl	_arc_reg_clr
	mov	x0, x19
	bl	_arc_free_tx_queue
	stp	xzr, xzr, [x20, #24]
	ldr	w0, [x20, #16]
Lloh17:
	adrp	x8, _TX_RING_SZ@GOTPAGE
Lloh18:
	ldr	x8, [x8, _TX_RING_SZ@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_memset
Lloh20:
	adrp	x27, _RX_BD_NUM@GOTPAGE
Lloh21:
	ldr	x27, [x27, _RX_BD_NUM@GOTPAGEOFF]
	ldr	w8, [x27]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.3:
	mov	x28, #0
Lloh22:
	adrp	x21, _FOR_EMAC@GOTPAGE
Lloh23:
	ldr	x21, [x21, _FOR_EMAC@GOTPAGEOFF]
	movi.2s	v8, #1
Lloh24:
	adrp	x22, _EMAC_BUFFER_SIZE@GOTPAGE
Lloh25:
	ldr	x22, [x22, _EMAC_BUFFER_SIZE@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w9, [x22]
	orr	w0, w9, w8
	bl	_cpu_to_le32
	str	w0, [x23, x28, lsl #2]
	add	x28, x28, #1
	ldrsw	x8, [x27]
	cmp	x28, x8
	b.ge	LBB0_7
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x23, [x20, #8]
	ldr	w0, [x23, x28, lsl #2]
	bl	_le32_to_cpu
	ldr	w8, [x21]
	tst	w8, w0
	b.ne	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	d0, [x19]
	add.2s	v0, v0, v8
	str	d0, [x19]
	ldr	w8, [x21]
	b	LBB0_4
LBB0_7:
	str	xzr, [x20]
	bl	_wmb
Lloh26:
	adrp	x8, _R_ENABLE@GOTPAGE
Lloh27:
	ldr	x8, [x8, _R_ENABLE@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
Lloh29:
	adrp	x8, _RXINT_MASK@GOTPAGE
Lloh30:
	ldr	x8, [x8, _RXINT_MASK@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
Lloh32:
	adrp	x9, _TXINT_MASK@GOTPAGE
Lloh33:
	ldr	x9, [x9, _TXINT_MASK@GOTPAGEOFF]
Lloh34:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	w9, [x24]
	orr	w2, w8, w9
	mov	x0, x20
	bl	_arc_reg_set
	ldr	w1, [x25]
	ldr	w2, [x26]
	mov	x0, x20
	bl	_arc_reg_or
	mov	x0, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp], #112              ; 16-byte Folded Reload
	b	_netif_start_queue
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"restarting stalled EMAC\n"

	.comm	_R_ENABLE,4,2                   ; @R_ENABLE
	.comm	_RXINT_MASK,4,2                 ; @RXINT_MASK
	.comm	_TXINT_MASK,4,2                 ; @TXINT_MASK
	.comm	_ERR_MASK,4,2                   ; @ERR_MASK
	.comm	_R_CTRL,4,2                     ; @R_CTRL
	.comm	_EN_MASK,4,2                    ; @EN_MASK
	.comm	_TX_RING_SZ,4,2                 ; @TX_RING_SZ
	.comm	_RX_BD_NUM,4,2                  ; @RX_BD_NUM
	.comm	_FOR_EMAC,4,2                   ; @FOR_EMAC
	.comm	_EMAC_BUFFER_SIZE,4,2           ; @EMAC_BUFFER_SIZE
	.no_dead_strip	_arc_emac_restart
.subsections_via_symbols
