	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function r852_dma_test
_r852_dma_test:                         ## @r852_dma_test
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movq	_R852_DMA_CAP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_r852_read_reg
	movq	_R852_DMA1@GOTPCREL(%rip), %rcx
	movq	_R852_DMA2@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	notl	%eax
	xorl	%ecx, %ecx
	testl	%eax, %edx
	sete	%cl
	movl	%ecx, (%rbx)
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_message
LBB0_2:
	movq	_r852_enable_dma@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jne	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rdi
	callq	_message
	movl	$0, (%rbx)
LBB0_4:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_R852_DMA_CAP,4,2               ## @R852_DMA_CAP
	.comm	_R852_DMA1,4,2                  ## @R852_DMA1
	.comm	_R852_DMA2,4,2                  ## @R852_DMA2
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Non dma capable device detected, dma disabled"

	.comm	_r852_enable_dma,4,2            ## @r852_enable_dma
L_.str.1:                               ## @.str.1
	.asciz	"disabling dma on user request"

	.no_dead_strip	_r852_dma_test
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function r852_dma_test
_r852_dma_test:                         ; @r852_dma_test
	.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
Lloh0:
	adrp	x8, _R852_DMA_CAP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _R852_DMA_CAP@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_r852_read_reg
Lloh3:
	adrp	x8, _R852_DMA1@GOTPAGE
Lloh4:
	ldr	x8, [x8, _R852_DMA1@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _R852_DMA2@GOTPAGE
Lloh7:
	ldr	x9, [x9, _R852_DMA2@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w8, w9, w8
	and	w9, w8, w0
	cmp	w9, w8
	cset	w8, eq
	str	w8, [x19]
	b.eq	LBB0_2
; %bb.1:
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_message
LBB0_2:
Lloh11:
	adrp	x8, _r852_enable_dma@GOTPAGE
Lloh12:
	ldr	x8, [x8, _r852_enable_dma@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	cbnz	w8, LBB0_4
; %bb.3:
Lloh14:
	adrp	x0, l_.str.1@PAGE
Lloh15:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_message
	str	wzr, [x19]
LBB0_4:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_R852_DMA_CAP,4,2               ; @R852_DMA_CAP
	.comm	_R852_DMA1,4,2                  ; @R852_DMA1
	.comm	_R852_DMA2,4,2                  ; @R852_DMA2
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Non dma capable device detected, dma disabled"

	.comm	_r852_enable_dma,4,2            ; @r852_enable_dma
l_.str.1:                               ; @.str.1
	.asciz	"disabling dma on user request"

	.no_dead_strip	_r852_dma_test
.subsections_via_symbols
