	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xgene_enet_setup_ring
_xgene_enet_setup_ring:                 ## @xgene_enet_setup_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	(%rdi), %r14
	callq	_xgene_enet_clr_ring_state
	movq	%r15, %rdi
	callq	_xgene_enet_set_ring_state
	movq	%r15, %rdi
	callq	_xgene_enet_set_ring_id
	movl	16(%r15), %edi
	movq	%r14, %rsi
	callq	_xgene_enet_get_numslots
	movq	%rax, 8(%r15)
	movl	16(%r15), %edi
	callq	_xgene_enet_is_bufpool
	testl	%eax, %eax
	jne	LBB0_6
## %bb.1:
	movl	16(%r15), %edi
	callq	_xgene_enet_ring_owner
	movq	_RING_OWNER_CPU@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.2:
	cmpq	$0, 8(%r15)
	je	LBB0_5
## %bb.3:
	xorl	%r14d, %r14d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	24(%r15), %rdi
	addq	%r14, %rdi
	callq	_xgene_enet_mark_desc_slot_empty
	incq	%rbx
	addq	$4, %r14
	cmpq	8(%r15), %rbx
	jb	LBB0_4
LBB0_5:
	movq	_CSR_RING_NE_INT_MODE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	leaq	-32(%rbp), %rdx
	movq	%r15, %rdi
	callq	_xgene_enet_ring_rd32
	movl	16(%r15), %edi
	callq	_xgene_enet_ring_bufnum
	movl	$31, %edi
	subq	%rax, %rdi
	callq	_BIT
	orq	-32(%rbp), %rax
	movq	%rax, -32(%rbp)
	movl	(%rbx), %esi
	movq	%r15, %rdi
	movq	%rax, %rdx
	callq	_xgene_enet_ring_wr32
LBB0_6:
	movq	%r15, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RING_OWNER_CPU,8,3             ## @RING_OWNER_CPU
	.comm	_CSR_RING_NE_INT_MODE,4,2       ## @CSR_RING_NE_INT_MODE
	.no_dead_strip	_xgene_enet_setup_ring
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xgene_enet_setup_ring
_xgene_enet_setup_ring:                 ; @xgene_enet_setup_ring
	.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	x20, [x0]
	bl	_xgene_enet_clr_ring_state
	mov	x0, x19
	bl	_xgene_enet_set_ring_state
	mov	x0, x19
	bl	_xgene_enet_set_ring_id
	ldr	w0, [x19, #16]
	mov	x1, x20
	bl	_xgene_enet_get_numslots
	str	x0, [x19, #8]
	ldr	w0, [x19, #16]
	bl	_xgene_enet_is_bufpool
	cbnz	w0, LBB0_6
; %bb.1:
	ldr	w0, [x19, #16]
	bl	_xgene_enet_ring_owner
Lloh0:
	adrp	x8, _RING_OWNER_CPU@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RING_OWNER_CPU@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_6
; %bb.2:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_5
; %bb.3:
	mov	x20, #0
	mov	x21, #0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #24]
	add	x0, x8, x20
	bl	_xgene_enet_mark_desc_slot_empty
	add	x21, x21, #1
	ldr	x8, [x19, #8]
	add	x20, x20, #4
	cmp	x21, x8
	b.lo	LBB0_4
LBB0_5:
Lloh3:
	adrp	x20, _CSR_RING_NE_INT_MODE@GOTPAGE
Lloh4:
	ldr	x20, [x20, _CSR_RING_NE_INT_MODE@GOTPAGEOFF]
	ldr	w1, [x20]
	add	x2, sp, #8
	mov	x0, x19
	bl	_xgene_enet_ring_rd32
	ldr	w0, [x19, #16]
	bl	_xgene_enet_ring_bufnum
	mov	w8, #31
	sub	x0, x8, x0
	bl	_BIT
	ldr	x8, [sp, #8]
	orr	x2, x8, x0
	str	x2, [sp, #8]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_xgene_enet_ring_wr32
LBB0_6:
	mov	x0, x19
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_RING_OWNER_CPU,8,3             ; @RING_OWNER_CPU
	.comm	_CSR_RING_NE_INT_MODE,4,2       ; @CSR_RING_NE_INT_MODE
	.no_dead_strip	_xgene_enet_setup_ring
.subsections_via_symbols
