	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xgene_dma_clear_ring
_xgene_dma_clear_ring:                  ## @xgene_dma_clear_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, %rbx
	movq	(%rdi), %rax
	movq	_XGENE_DMA_RING_OWNER_CPU@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movq	8(%rbx), %rax
	movq	_XGENE_DMA_RING_NE_INT_MODE@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	addq	(%rax), %rdi
	callq	_ioread32
	movl	%eax, %r14d
	movl	20(%rbx), %esi
	movl	%eax, %edi
	callq	_XGENE_DMA_RING_NE_INT_MODE_RESET
	movq	8(%rbx), %rax
	movq	(%r15), %rsi
	addq	(%rax), %rsi
	movl	%r14d, %edi
	callq	_iowrite32
LBB0_2:
	movl	16(%rbx), %edi
	callq	_XGENE_DMA_RING_ID_SETUP
	movq	8(%rbx), %rcx
	movq	_XGENE_DMA_RING_ID@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rsi
	addq	(%rcx), %rsi
	movl	%eax, %edi
	callq	_iowrite32
	movq	8(%rbx), %rax
	movq	_XGENE_DMA_RING_ID_BUF@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	addq	(%rax), %rsi
	xorl	%edi, %edi
	callq	_iowrite32
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_xgene_dma_clr_ring_state       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_XGENE_DMA_RING_OWNER_CPU,8,3   ## @XGENE_DMA_RING_OWNER_CPU
	.comm	_XGENE_DMA_RING_NE_INT_MODE,8,3 ## @XGENE_DMA_RING_NE_INT_MODE
	.comm	_XGENE_DMA_RING_ID,8,3          ## @XGENE_DMA_RING_ID
	.comm	_XGENE_DMA_RING_ID_BUF,8,3      ## @XGENE_DMA_RING_ID_BUF
	.no_dead_strip	_xgene_dma_clear_ring
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xgene_dma_clear_ring
_xgene_dma_clear_ring:                  ; @xgene_dma_clear_ring
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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]
Lloh0:
	adrp	x9, _XGENE_DMA_RING_OWNER_CPU@GOTPAGE
Lloh1:
	ldr	x9, [x9, _XGENE_DMA_RING_OWNER_CPU@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
Lloh3:
	adrp	x21, _XGENE_DMA_RING_NE_INT_MODE@GOTPAGE
Lloh4:
	ldr	x21, [x21, _XGENE_DMA_RING_NE_INT_MODE@GOTPAGEOFF]
	ldr	x9, [x21]
	add	x0, x9, x8
	bl	_ioread32
	mov	x20, x0
	ldr	w1, [x19, #20]
	bl	_XGENE_DMA_RING_NE_INT_MODE_RESET
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	ldr	x9, [x21]
	add	x1, x9, x8
	mov	x0, x20
	bl	_iowrite32
LBB0_2:
	ldr	w0, [x19, #16]
	bl	_XGENE_DMA_RING_ID_SETUP
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
Lloh5:
	adrp	x9, _XGENE_DMA_RING_ID@GOTPAGE
Lloh6:
	ldr	x9, [x9, _XGENE_DMA_RING_ID@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_iowrite32
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
Lloh8:
	adrp	x9, _XGENE_DMA_RING_ID_BUF@GOTPAGE
Lloh9:
	ldr	x9, [x9, _XGENE_DMA_RING_ID_BUF@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	w0, #0
	bl	_iowrite32
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_xgene_dma_clr_ring_state
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_XGENE_DMA_RING_OWNER_CPU,8,3   ; @XGENE_DMA_RING_OWNER_CPU
	.comm	_XGENE_DMA_RING_NE_INT_MODE,8,3 ; @XGENE_DMA_RING_NE_INT_MODE
	.comm	_XGENE_DMA_RING_ID,8,3          ; @XGENE_DMA_RING_ID
	.comm	_XGENE_DMA_RING_ID_BUF,8,3      ; @XGENE_DMA_RING_ID_BUF
	.no_dead_strip	_xgene_dma_clear_ring
.subsections_via_symbols
