	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xgene_dma_init_mem
_xgene_dma_init_mem:                    ## @xgene_dma_init_mem
	.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, %r14
	callq	_xgene_dma_init_ring_mngr
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_3
## %bb.1:
	movq	_XGENE_DMA_MEM_RAM_SHUTDOWN@GOTPCREL(%rip), %r15
	movq	(%r15), %rsi
	addq	8(%r14), %rsi
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	callq	_iowrite32
	movq	(%r15), %rdi
	addq	8(%r14), %rdi
	callq	_ioread32
	movl	$1000, %edi                     ## imm = 0x3E8
	movl	$1100, %esi                     ## imm = 0x44C
	callq	_usleep_range
	movq	_XGENE_DMA_BLK_MEM_RDY@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%r14), %rdi
	callq	_ioread32
	movq	_XGENE_DMA_BLK_MEM_RDY_VAL@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_3
## %bb.2:
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_3:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_XGENE_DMA_MEM_RAM_SHUTDOWN,8,3 ## @XGENE_DMA_MEM_RAM_SHUTDOWN
	.comm	_XGENE_DMA_BLK_MEM_RDY,8,3      ## @XGENE_DMA_BLK_MEM_RDY
	.comm	_XGENE_DMA_BLK_MEM_RDY_VAL,8,3  ## @XGENE_DMA_BLK_MEM_RDY_VAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to release DMA memory from shutdown\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.no_dead_strip	_xgene_dma_init_mem
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xgene_dma_init_mem
_xgene_dma_init_mem:                    ; @xgene_dma_init_mem
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	bl	_xgene_dma_init_ring_mngr
	cbnz	w0, LBB0_3
; %bb.1:
	ldr	x8, [x19, #8]
Lloh0:
	adrp	x20, _XGENE_DMA_MEM_RAM_SHUTDOWN@GOTPAGE
Lloh1:
	ldr	x20, [x20, _XGENE_DMA_MEM_RAM_SHUTDOWN@GOTPAGEOFF]
	ldr	x9, [x20]
	add	x1, x9, x8
	bl	_iowrite32
	ldr	x8, [x19, #8]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_ioread32
	mov	w0, #1000
	mov	w1, #1100
	bl	_usleep_range
	ldr	x8, [x19, #8]
Lloh2:
	adrp	x9, _XGENE_DMA_BLK_MEM_RDY@GOTPAGE
Lloh3:
	ldr	x9, [x9, _XGENE_DMA_BLK_MEM_RDY@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_ioread32
	mov	x8, x0
	mov	w0, #0
Lloh5:
	adrp	x9, _XGENE_DMA_BLK_MEM_RDY_VAL@GOTPAGE
Lloh6:
	ldr	x9, [x9, _XGENE_DMA_BLK_MEM_RDY_VAL@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_3
; %bb.2:
	ldr	w0, [x19]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh10:
	adrp	x8, _ENODEV@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_XGENE_DMA_MEM_RAM_SHUTDOWN,8,3 ; @XGENE_DMA_MEM_RAM_SHUTDOWN
	.comm	_XGENE_DMA_BLK_MEM_RDY,8,3      ; @XGENE_DMA_BLK_MEM_RDY
	.comm	_XGENE_DMA_BLK_MEM_RDY_VAL,8,3  ; @XGENE_DMA_BLK_MEM_RDY_VAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to release DMA memory from shutdown\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.no_dead_strip	_xgene_dma_init_mem
.subsections_via_symbols
