	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function moxart_mac_setup_desc_ring
_moxart_mac_setup_desc_ring:            ## @moxart_mac_setup_desc_ring
	.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, %r15
	movq	_TX_DESC_NUM@GOTPCREL(%rip), %r12
	cmpl	$0, (%r12)
	jle	LBB0_1
## %bb.2:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	_TX_REG_DESC_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%edx, %eax
	imull	%ebx, %eax
	movslq	%eax, %r13
	addq	96(%r15), %r13
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_memset
	movslq	(%r15), %rax
	movslq	%ebx, %rcx
	imulq	%rax, %rcx
	addq	80(%r15), %rcx
	movq	88(%r15), %rax
	movq	%rcx, (%rax,%rbx,8)
	incq	%rbx
	movslq	(%r12), %rax
	cmpq	%rax, %rbx
	jl	LBB0_3
	jmp	LBB0_4
LBB0_1:
                                        ## implicit-def: $r13
LBB0_4:
	movq	_TX_DESC1_END@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	_TX_REG_OFFSET_DESC1@GOTPCREL(%rip), %rax
	movslq	(%rax), %rsi
	addq	%r13, %rsi
	callq	_moxart_desc_write
	xorps	%xmm0, %xmm0
	movups	%xmm0, 64(%r15)
	movq	_RX_DESC_NUM@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_9
## %bb.5:
	xorl	%r12d, %r12d
	movq	_RX_REG_OFFSET_DESC2@GOTPCREL(%rip), %rbx
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	8(%r15), %rax
	movq	(%rax,%r12,8), %rdi
	movslq	(%rbx), %rax
	addq	%r13, %rax
	movq	_RX_DESC2_ADDRESS_PHYS@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rsi
	addq	%rax, %rsi
	callq	_moxart_desc_write
	movq	40(%r15), %rax
	movq	(%rax,%r12,8), %rdi
	movslq	(%rbx), %rax
	addq	%r13, %rax
	movq	_RX_DESC2_ADDRESS_VIRT@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rsi
	addq	%rax, %rsi
	callq	_moxart_desc_write
	incq	%r12
	movq	_RX_DESC_NUM@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	cmpq	%rax, %r12
	jge	LBB0_9
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	_RX_REG_DESC_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%edx, %eax
	imull	%r12d, %eax
	movslq	%eax, %r13
	addq	56(%r15), %r13
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_memset
	movq	_RX_DESC0_DMA_OWN@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	_RX_REG_OFFSET_DESC0@GOTPCREL(%rip), %rax
	movslq	(%rax), %rsi
	addq	%r13, %rsi
	callq	_moxart_desc_write
	movq	_RX_DESC1_BUF_SIZE_MASK@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	_RX_BUF_SIZE@GOTPCREL(%rip), %rax
	andq	(%rax), %rdi
	movq	_RX_REG_OFFSET_DESC1@GOTPCREL(%rip), %rax
	movslq	(%rax), %rsi
	addq	%r13, %rsi
	callq	_moxart_desc_write
	movl	4(%r15), %edx
	movl	%edx, %eax
	imull	%r12d, %eax
	movslq	%eax, %rsi
	addq	48(%r15), %rsi
	movq	40(%r15), %rax
	movq	%rsi, (%rax,%r12,8)
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	callq	_dma_map_single
	movq	8(%r15), %rcx
	movq	%rax, (%rcx,%r12,8)
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_dma_mapping_error
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	%r14, %rdi
	leaq	L_.str(%rip), %rsi
	callq	_netdev_err
	jmp	LBB0_8
LBB0_9:
	movq	_RX_DESC1_END@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	_RX_REG_OFFSET_DESC1@GOTPCREL(%rip), %rax
	movslq	(%rax), %rsi
	addq	%r13, %rsi
	callq	_moxart_desc_write
	movq	$0, 32(%r15)
	movl	28(%r15), %edi
	movq	_REG_TXR_BASE_ADDRESS@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%r15), %rsi
	callq	_writel
	movl	24(%r15), %edi
	movq	_REG_RXR_BASE_ADDRESS@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%r15), %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_writel                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_TX_DESC_NUM,4,2                ## @TX_DESC_NUM
	.comm	_TX_REG_DESC_SIZE,4,2           ## @TX_REG_DESC_SIZE
	.comm	_TX_DESC1_END,8,3               ## @TX_DESC1_END
	.comm	_TX_REG_OFFSET_DESC1,4,2        ## @TX_REG_OFFSET_DESC1
	.comm	_RX_DESC_NUM,4,2                ## @RX_DESC_NUM
	.comm	_RX_REG_DESC_SIZE,4,2           ## @RX_REG_DESC_SIZE
	.comm	_RX_DESC0_DMA_OWN,8,3           ## @RX_DESC0_DMA_OWN
	.comm	_RX_REG_OFFSET_DESC0,4,2        ## @RX_REG_OFFSET_DESC0
	.comm	_RX_BUF_SIZE,8,3                ## @RX_BUF_SIZE
	.comm	_RX_DESC1_BUF_SIZE_MASK,8,3     ## @RX_DESC1_BUF_SIZE_MASK
	.comm	_RX_REG_OFFSET_DESC1,4,2        ## @RX_REG_OFFSET_DESC1
	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"DMA mapping error\n"

	.comm	_RX_REG_OFFSET_DESC2,4,2        ## @RX_REG_OFFSET_DESC2
	.comm	_RX_DESC2_ADDRESS_PHYS,4,2      ## @RX_DESC2_ADDRESS_PHYS
	.comm	_RX_DESC2_ADDRESS_VIRT,4,2      ## @RX_DESC2_ADDRESS_VIRT
	.comm	_RX_DESC1_END,8,3               ## @RX_DESC1_END
	.comm	_REG_TXR_BASE_ADDRESS,8,3       ## @REG_TXR_BASE_ADDRESS
	.comm	_REG_RXR_BASE_ADDRESS,8,3       ## @REG_RXR_BASE_ADDRESS
	.no_dead_strip	_moxart_mac_setup_desc_ring
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function moxart_mac_setup_desc_ring
_moxart_mac_setup_desc_ring:            ; @moxart_mac_setup_desc_ring
	.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	x20, x0
	bl	_netdev_priv
	mov	x19, x0
Lloh0:
	adrp	x22, _TX_DESC_NUM@GOTPAGE
Lloh1:
	ldr	x22, [x22, _TX_DESC_NUM@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.1:
	mov	x23, #0
Lloh2:
	adrp	x24, _TX_REG_DESC_SIZE@GOTPAGE
Lloh3:
	ldr	x24, [x24, _TX_REG_DESC_SIZE@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #96]
	ldr	w2, [x24]
	mul	w9, w2, w23
	add	x21, x8, w9, sxtw
	mov	x0, x21
	mov	w1, #0
	bl	_memset
	ldrsw	x8, [x19]
	sxtw	x9, w23
	ldp	x10, x11, [x19, #80]
	madd	x8, x8, x9, x10
	str	x8, [x11, x23, lsl #3]
	add	x23, x23, #1
	ldrsw	x8, [x22]
	cmp	x23, x8
	b.lt	LBB0_2
	b	LBB0_4
LBB0_3:
                                        ; implicit-def: $x21
LBB0_4:
Lloh4:
	adrp	x8, _TX_DESC1_END@GOTPAGE
Lloh5:
	ldr	x8, [x8, _TX_DESC1_END@GOTPAGEOFF]
Lloh6:
	ldr	x0, [x8]
Lloh7:
	adrp	x8, _TX_REG_OFFSET_DESC1@GOTPAGE
Lloh8:
	ldr	x8, [x8, _TX_REG_OFFSET_DESC1@GOTPAGEOFF]
Lloh9:
	ldrsw	x8, [x8]
	add	x1, x21, x8
	bl	_moxart_desc_write
	stp	xzr, xzr, [x19, #64]
Lloh10:
	adrp	x8, _RX_DESC_NUM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _RX_DESC_NUM@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.5:
	mov	x25, #0
Lloh13:
	adrp	x23, _RX_DESC1_BUF_SIZE_MASK@GOTPAGE
Lloh14:
	ldr	x23, [x23, _RX_DESC1_BUF_SIZE_MASK@GOTPAGEOFF]
Lloh15:
	adrp	x24, _DMA_FROM_DEVICE@GOTPAGE
Lloh16:
	ldr	x24, [x24, _DMA_FROM_DEVICE@GOTPAGEOFF]
Lloh17:
	adrp	x26, _RX_REG_OFFSET_DESC2@GOTPAGE
Lloh18:
	ldr	x26, [x26, _RX_REG_OFFSET_DESC2@GOTPAGEOFF]
Lloh19:
	adrp	x27, _RX_DESC2_ADDRESS_PHYS@GOTPAGE
Lloh20:
	ldr	x27, [x27, _RX_DESC2_ADDRESS_PHYS@GOTPAGEOFF]
Lloh21:
	adrp	x28, _RX_DESC2_ADDRESS_VIRT@GOTPAGE
Lloh22:
	ldr	x28, [x28, _RX_DESC2_ADDRESS_VIRT@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [x19, #8]
	ldr	x0, [x8, x22]
	ldrsw	x8, [x26]
	ldrsw	x9, [x27]
	add	x8, x21, x8
	add	x1, x8, x9
	bl	_moxart_desc_write
	ldr	x8, [x19, #40]
	ldr	x0, [x8, x22]
	ldrsw	x8, [x26]
	ldrsw	x9, [x28]
	add	x8, x21, x8
	add	x1, x8, x9
	bl	_moxart_desc_write
	add	x25, x25, #1
Lloh23:
	adrp	x8, _RX_DESC_NUM@GOTPAGE
Lloh24:
	ldr	x8, [x8, _RX_DESC_NUM@GOTPAGEOFF]
Lloh25:
	ldrsw	x8, [x8]
	cmp	x25, x8
	b.ge	LBB0_9
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #56]
Lloh26:
	adrp	x9, _RX_REG_DESC_SIZE@GOTPAGE
Lloh27:
	ldr	x9, [x9, _RX_REG_DESC_SIZE@GOTPAGEOFF]
Lloh28:
	ldr	w2, [x9]
	mul	w9, w2, w25
	add	x21, x8, w9, sxtw
	mov	x0, x21
	mov	w1, #0
	bl	_memset
Lloh29:
	adrp	x8, _RX_DESC0_DMA_OWN@GOTPAGE
Lloh30:
	ldr	x8, [x8, _RX_DESC0_DMA_OWN@GOTPAGEOFF]
Lloh31:
	ldr	x0, [x8]
Lloh32:
	adrp	x8, _RX_REG_OFFSET_DESC0@GOTPAGE
Lloh33:
	ldr	x8, [x8, _RX_REG_OFFSET_DESC0@GOTPAGEOFF]
Lloh34:
	ldrsw	x8, [x8]
	add	x1, x21, x8
	bl	_moxart_desc_write
Lloh35:
	adrp	x8, _RX_BUF_SIZE@GOTPAGE
Lloh36:
	ldr	x8, [x8, _RX_BUF_SIZE@GOTPAGEOFF]
Lloh37:
	ldr	x8, [x8]
	ldr	x9, [x23]
	and	x0, x9, x8
Lloh38:
	adrp	x8, _RX_REG_OFFSET_DESC1@GOTPAGE
Lloh39:
	ldr	x8, [x8, _RX_REG_OFFSET_DESC1@GOTPAGEOFF]
Lloh40:
	ldrsw	x8, [x8]
	add	x1, x21, x8
	bl	_moxart_desc_write
	ldr	w2, [x19, #4]
	mul	w8, w2, w25
	ldp	x10, x9, [x19, #40]
	add	x1, x9, w8, sxtw
	lsl	x22, x25, #3
	str	x1, [x10, x22]
	ldr	w3, [x24]
	mov	x0, x20
	bl	_dma_map_single
	mov	x1, x0
	ldr	x8, [x19, #8]
	str	x0, [x8, x22]
	mov	x0, x20
	bl	_dma_mapping_error
	cbz	x0, LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x20
Lloh41:
	adrp	x1, l_.str@PAGE
Lloh42:
	add	x1, x1, l_.str@PAGEOFF
	bl	_netdev_err
	b	LBB0_6
LBB0_9:
Lloh43:
	adrp	x8, _RX_DESC1_END@GOTPAGE
Lloh44:
	ldr	x8, [x8, _RX_DESC1_END@GOTPAGEOFF]
Lloh45:
	ldr	x0, [x8]
Lloh46:
	adrp	x8, _RX_REG_OFFSET_DESC1@GOTPAGE
Lloh47:
	ldr	x8, [x8, _RX_REG_OFFSET_DESC1@GOTPAGEOFF]
Lloh48:
	ldrsw	x8, [x8]
	add	x1, x21, x8
	bl	_moxart_desc_write
	str	xzr, [x19, #32]
	ldr	w0, [x19, #28]
	ldr	x8, [x19, #16]
Lloh49:
	adrp	x9, _REG_TXR_BASE_ADDRESS@GOTPAGE
Lloh50:
	ldr	x9, [x9, _REG_TXR_BASE_ADDRESS@GOTPAGEOFF]
Lloh51:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	ldr	w0, [x19, #24]
	ldr	x8, [x19, #16]
Lloh52:
	adrp	x9, _REG_RXR_BASE_ADDRESS@GOTPAGE
Lloh53:
	ldr	x9, [x9, _REG_RXR_BASE_ADDRESS@GOTPAGEOFF]
Lloh54:
	ldr	x9, [x9]
	add	x1, x9, x8
	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
	b	_writel
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.cfi_endproc
                                        ; -- End function
	.comm	_TX_DESC_NUM,4,2                ; @TX_DESC_NUM
	.comm	_TX_REG_DESC_SIZE,4,2           ; @TX_REG_DESC_SIZE
	.comm	_TX_DESC1_END,8,3               ; @TX_DESC1_END
	.comm	_TX_REG_OFFSET_DESC1,4,2        ; @TX_REG_OFFSET_DESC1
	.comm	_RX_DESC_NUM,4,2                ; @RX_DESC_NUM
	.comm	_RX_REG_DESC_SIZE,4,2           ; @RX_REG_DESC_SIZE
	.comm	_RX_DESC0_DMA_OWN,8,3           ; @RX_DESC0_DMA_OWN
	.comm	_RX_REG_OFFSET_DESC0,4,2        ; @RX_REG_OFFSET_DESC0
	.comm	_RX_BUF_SIZE,8,3                ; @RX_BUF_SIZE
	.comm	_RX_DESC1_BUF_SIZE_MASK,8,3     ; @RX_DESC1_BUF_SIZE_MASK
	.comm	_RX_REG_OFFSET_DESC1,4,2        ; @RX_REG_OFFSET_DESC1
	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DMA mapping error\n"

	.comm	_RX_REG_OFFSET_DESC2,4,2        ; @RX_REG_OFFSET_DESC2
	.comm	_RX_DESC2_ADDRESS_PHYS,4,2      ; @RX_DESC2_ADDRESS_PHYS
	.comm	_RX_DESC2_ADDRESS_VIRT,4,2      ; @RX_DESC2_ADDRESS_VIRT
	.comm	_RX_DESC1_END,8,3               ; @RX_DESC1_END
	.comm	_REG_TXR_BASE_ADDRESS,8,3       ; @REG_TXR_BASE_ADDRESS
	.comm	_REG_RXR_BASE_ADDRESS,8,3       ; @REG_RXR_BASE_ADDRESS
	.no_dead_strip	_moxart_mac_setup_desc_ring
.subsections_via_symbols
