	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function arc_emac_open
LCPI0_0:
	.space	16
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_arc_emac_open:                         ## @arc_emac_open
	.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
	callq	_netdev_priv
	movq	%rax, %r13
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	(%rbx), %rax
	movq	_AUTONEG_ENABLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 24(%rax)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 8(%rax)
	movl	(%rax), %edx
	movl	4(%rax), %edi
	movl	%edi, %esi
	callq	_linkmode_and
	movl	$0, (%r13)
	movq	_RX_BD_NUM@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_7
## %bb.1:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	addq	$8, %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	_EMAC_BUFFER_SIZE@GOTPCREL(%rip), %r15
	xorl	%edx, %edx
	xorl	%ebx, %ebx
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	48(%r13), %r14
	movq	56(%r13), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movl	%edx, %r12d
	movl	(%r15), %esi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_netdev_alloc_skb_ip_align
	movq	%rax, (%r14,%r12,8)
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%ebx, -52(%rbp)                 ## 4-byte Spill
	leaq	(%r14,%r12,8), %r13
	movq	(%r13), %rax
	movq	(%rax), %rsi
	movq	%r15, %r14
	movl	(%r15), %edx
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	callq	_dma_map_single
	movl	%eax, %ebx
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_dma_mapping_error
	testq	%rax, %rax
	jne	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r13, %rdi
	movl	%ebx, %esi
	movl	%ebx, %edx
	callq	_dma_unmap_addr_set
	movq	_len@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %r15
	movl	(%r14), %edx
	movq	%r13, %rdi
	callq	_dma_unmap_len_set
	movl	%ebx, %edi
	callq	_cpu_to_le32
	shlq	$4, %r12
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	movq	%rax, 8(%rbx,%r12)
	xorl	%eax, %eax
	callq	_wmb
	movl	(%r14), %edi
	movq	_FOR_EMAC@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	callq	_cpu_to_le32
	movq	%rax, (%rbx,%r12)
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	movl	(%r13), %eax
	incl	%eax
	xorl	%edx, %edx
	movq	_RX_BD_NUM@GOTPCREL(%rip), %rcx
	divl	(%rcx)
	movl	%edx, (%r13)
	movl	-52(%rbp), %ebx                 ## 4-byte Reload
	incl	%ebx
	cmpl	(%rcx), %ebx
	jl	LBB0_2
LBB0_7:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 32(%r13)
	movl	24(%r13), %edi
	movq	_TX_RING_SZ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%r15d, %r15d
	xorl	%esi, %esi
	callq	_memset
	movq	_R_LAFL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	_arc_reg_set
	movq	_R_LAFH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	_arc_reg_set
	movq	_R_RX_RING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	16(%r13), %edx
	movq	%r13, %rdi
	callq	_arc_reg_set
	movq	_R_TX_RING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	8(%r13), %edx
	movq	%r13, %rdi
	callq	_arc_reg_set
	movq	_R_ENABLE@GOTPCREL(%rip), %rax
	movq	_RXINT_MASK@GOTPCREL(%rip), %rcx
	movq	_TXINT_MASK@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movl	(%rax), %esi
	movq	_ERR_MASK@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	%r13, %rdi
	callq	_arc_reg_set
	movq	_R_CTRL@GOTPCREL(%rip), %rbx
	movq	_RX_BD_NUM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shll	$24, %eax
	movq	_TX_BD_NUM@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	shll	$16, %edx
	orl	%eax, %edx
	movq	_TXRN_MASK@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movl	(%rbx), %esi
	movq	_RXRN_MASK@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	%r13, %rdi
	callq	_arc_reg_set
	movq	%r13, %rdi
	addq	$4, %rdi
	callq	_napi_enable
	movl	(%rbx), %esi
	movq	_EN_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	callq	_arc_reg_or
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	(%rbx), %rdi
	callq	_phy_start
	movq	%rbx, %rdi
	callq	_netif_start_queue
	jmp	LBB0_8
LBB0_5:
	leaq	L_.str(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_netdev_err
	movq	(%r13), %rdi
	callq	_dev_kfree_skb
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_8:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AUTONEG_ENABLE,4,2             ## @AUTONEG_ENABLE
	.comm	_RX_BD_NUM,4,2                  ## @RX_BD_NUM
	.comm	_EMAC_BUFFER_SIZE,4,2           ## @EMAC_BUFFER_SIZE
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cannot dma map\n"

	.comm	_len,4,2                        ## @len
	.comm	_FOR_EMAC,4,2                   ## @FOR_EMAC
	.comm	_TX_RING_SZ,4,2                 ## @TX_RING_SZ
	.comm	_R_LAFL,4,2                     ## @R_LAFL
	.comm	_R_LAFH,4,2                     ## @R_LAFH
	.comm	_R_RX_RING,4,2                  ## @R_RX_RING
	.comm	_R_TX_RING,4,2                  ## @R_TX_RING
	.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	_TX_BD_NUM,4,2                  ## @TX_BD_NUM
	.comm	_TXRN_MASK,4,2                  ## @TXRN_MASK
	.comm	_RXRN_MASK,4,2                  ## @RXRN_MASK
	.comm	_EN_MASK,4,2                    ## @EN_MASK
	.no_dead_strip	_arc_emac_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function arc_emac_open
_arc_emac_open:                         ; @arc_emac_open
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	bl	_netdev_priv
	mov	x20, x0
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _AUTONEG_ENABLE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AUTONEG_ENABLE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	str	w9, [x8, #24]
	stp	xzr, xzr, [x8, #8]
	ldp	w2, w0, [x8]
	mov	x1, x0
	bl	_linkmode_and
	str	wzr, [x20]
Lloh3:
	adrp	x24, _RX_BD_NUM@GOTPAGE
Lloh4:
	ldr	x24, [x24, _RX_BD_NUM@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.1:
	mov	w28, #0
	mov	w25, #0
	add	x21, x19, #8
Lloh5:
	adrp	x26, _EMAC_BUFFER_SIZE@GOTPAGE
Lloh6:
	ldr	x26, [x26, _EMAC_BUFFER_SIZE@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldp	x8, x27, [x20, #48]
	add	x22, x8, w28, uxtw #3
	ldr	w1, [x26]
	mov	x0, x19
	bl	_netdev_alloc_skb_ip_align
	str	x0, [x22]
	cmp	x0, #0
	cset	w0, eq
	bl	_unlikely
	cbnz	x0, LBB0_7
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x22]
	ldr	x1, [x8]
	ldr	w2, [x26]
Lloh7:
	adrp	x8, _DMA_FROM_DEVICE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _DMA_FROM_DEVICE@GOTPAGEOFF]
Lloh9:
	ldr	w3, [x8]
	mov	x0, x21
	bl	_dma_map_single
	mov	x23, x0
	mov	x0, x21
	mov	x1, x23
	bl	_dma_mapping_error
	cbnz	x0, LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w28, w28
	mov	x0, x22
	mov	x1, x23
	mov	x2, x23
	bl	_dma_unmap_addr_set
Lloh10:
	adrp	x8, _len@GOTPAGE
Lloh11:
	ldr	x8, [x8, _len@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	ldr	w2, [x26]
	mov	x0, x22
	bl	_dma_unmap_len_set
	mov	x0, x23
	bl	_cpu_to_le32
	add	x22, x27, x28, lsl #4
	str	x0, [x22, #8]
	bl	_wmb
Lloh13:
	adrp	x8, _FOR_EMAC@GOTPAGE
Lloh14:
	ldr	x8, [x8, _FOR_EMAC@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	ldr	w9, [x26]
	orr	w0, w9, w8
	bl	_cpu_to_le32
	str	x0, [x22]
	ldr	w8, [x20]
	add	w8, w8, #1
	ldr	w9, [x24]
	udiv	w10, w8, w9
	msub	w28, w10, w9, w8
	str	w28, [x20]
	add	w25, w25, #1
	ldr	w8, [x24]
	cmp	w25, w8
	b.lt	LBB0_2
LBB0_5:
	stp	xzr, xzr, [x20, #32]
	ldr	w0, [x20, #24]
Lloh16:
	adrp	x8, _TX_RING_SZ@GOTPAGE
Lloh17:
	ldr	x8, [x8, _TX_RING_SZ@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_memset
Lloh19:
	adrp	x8, _R_LAFL@GOTPAGE
Lloh20:
	ldr	x8, [x8, _R_LAFL@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #0
	bl	_arc_reg_set
Lloh22:
	adrp	x8, _R_LAFH@GOTPAGE
Lloh23:
	ldr	x8, [x8, _R_LAFH@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #0
	bl	_arc_reg_set
Lloh25:
	adrp	x8, _R_RX_RING@GOTPAGE
Lloh26:
	ldr	x8, [x8, _R_RX_RING@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	ldr	w2, [x20, #16]
	mov	x0, x20
	bl	_arc_reg_set
Lloh28:
	adrp	x8, _R_TX_RING@GOTPAGE
Lloh29:
	ldr	x8, [x8, _R_TX_RING@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	ldr	w2, [x20, #8]
	mov	x0, x20
	bl	_arc_reg_set
Lloh31:
	adrp	x8, _R_ENABLE@GOTPAGE
Lloh32:
	ldr	x8, [x8, _R_ENABLE@GOTPAGEOFF]
Lloh33:
	ldr	w1, [x8]
Lloh34:
	adrp	x8, _RXINT_MASK@GOTPAGE
Lloh35:
	ldr	x8, [x8, _RXINT_MASK@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
Lloh37:
	adrp	x9, _TXINT_MASK@GOTPAGE
Lloh38:
	ldr	x9, [x9, _TXINT_MASK@GOTPAGEOFF]
Lloh39:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh40:
	adrp	x9, _ERR_MASK@GOTPAGE
Lloh41:
	ldr	x9, [x9, _ERR_MASK@GOTPAGEOFF]
Lloh42:
	ldr	w9, [x9]
	orr	w2, w8, w9
	mov	x0, x20
	bl	_arc_reg_set
Lloh43:
	adrp	x21, _R_CTRL@GOTPAGE
Lloh44:
	ldr	x21, [x21, _R_CTRL@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh45:
	adrp	x8, _TX_BD_NUM@GOTPAGE
Lloh46:
	ldr	x8, [x8, _TX_BD_NUM@GOTPAGEOFF]
	ldr	w9, [x24]
Lloh47:
	ldr	w8, [x8]
	lsl	w8, w8, #16
	orr	w8, w8, w9, lsl #24
Lloh48:
	adrp	x9, _TXRN_MASK@GOTPAGE
Lloh49:
	ldr	x9, [x9, _TXRN_MASK@GOTPAGEOFF]
Lloh50:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh51:
	adrp	x9, _RXRN_MASK@GOTPAGE
Lloh52:
	ldr	x9, [x9, _RXRN_MASK@GOTPAGEOFF]
Lloh53:
	ldr	w9, [x9]
	orr	w2, w8, w9
	mov	x0, x20
	bl	_arc_reg_set
	add	x0, x20, #4
	bl	_napi_enable
	ldr	w1, [x21]
Lloh54:
	adrp	x8, _EN_MASK@GOTPAGE
Lloh55:
	ldr	x8, [x8, _EN_MASK@GOTPAGEOFF]
Lloh56:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_arc_reg_or
	ldr	x0, [x19]
	bl	_phy_start
	mov	x0, x19
	bl	_netif_start_queue
	mov	w0, #0
	b	LBB0_8
LBB0_6:
Lloh57:
	adrp	x1, l_.str@PAGE
Lloh58:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_netdev_err
	ldr	x0, [x22]
	bl	_dev_kfree_skb
LBB0_7:
Lloh59:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh60:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh61:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh54, Lloh55, Lloh56
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGot	Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh57, Lloh58
	.loh AdrpLdrGotLdr	Lloh59, Lloh60, Lloh61
	.cfi_endproc
                                        ; -- End function
	.comm	_AUTONEG_ENABLE,4,2             ; @AUTONEG_ENABLE
	.comm	_RX_BD_NUM,4,2                  ; @RX_BD_NUM
	.comm	_EMAC_BUFFER_SIZE,4,2           ; @EMAC_BUFFER_SIZE
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cannot dma map\n"

	.comm	_len,4,2                        ; @len
	.comm	_FOR_EMAC,4,2                   ; @FOR_EMAC
	.comm	_TX_RING_SZ,4,2                 ; @TX_RING_SZ
	.comm	_R_LAFL,4,2                     ; @R_LAFL
	.comm	_R_LAFH,4,2                     ; @R_LAFH
	.comm	_R_RX_RING,4,2                  ; @R_RX_RING
	.comm	_R_TX_RING,4,2                  ; @R_TX_RING
	.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	_TX_BD_NUM,4,2                  ; @TX_BD_NUM
	.comm	_TXRN_MASK,4,2                  ; @TXRN_MASK
	.comm	_RXRN_MASK,4,2                  ; @RXRN_MASK
	.comm	_EN_MASK,4,2                    ; @EN_MASK
	.no_dead_strip	_arc_emac_open
.subsections_via_symbols
