	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dma_halt
_dma_halt:                              ## @dma_halt
	.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
	callq	_get_mr
	movq	_FSL_DMA_IP_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	(%r15), %ecx
	movl	%eax, %r14d
	movq	_FSL_DMA_IP_85XX@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ecx
	jne	LBB0_2
## %bb.1:
	movq	_FSL_DMA_MR_CA@GOTPCREL(%rip), %rbx
	orl	(%rbx), %r14d
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_set_mr
	movl	(%rbx), %eax
	notl	%eax
	andl	%eax, %r14d
LBB0_2:
	movq	_FSL_DMA_MR_CS@GOTPCREL(%rip), %rax
	movq	_FSL_DMA_MR_EMS_EN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	notl	%esi
	andl	%r14d, %esi
	movq	%r15, %rdi
	callq	_set_mr
	movl	$100, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	callq	_dma_is_idle
	testq	%rax, %rax
	jne	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	$10, %edi
	callq	_udelay
	decl	%ebx
	jne	LBB0_3
## %bb.5:
	movq	%r15, %rdi
	callq	_dma_is_idle
	testq	%rax, %rax
	je	LBB0_7
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_chan_err                       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_FSL_DMA_IP_MASK,4,2            ## @FSL_DMA_IP_MASK
	.comm	_FSL_DMA_IP_85XX,4,2            ## @FSL_DMA_IP_85XX
	.comm	_FSL_DMA_MR_CA,4,2              ## @FSL_DMA_MR_CA
	.comm	_FSL_DMA_MR_CS,4,2              ## @FSL_DMA_MR_CS
	.comm	_FSL_DMA_MR_EMS_EN,4,2          ## @FSL_DMA_MR_EMS_EN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"DMA halt timeout!\n"

	.no_dead_strip	_dma_halt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dma_halt
_dma_halt:                              ; @dma_halt
	.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
	bl	_get_mr
	ldr	w8, [x19]
Lloh0:
	adrp	x9, _FSL_DMA_IP_MASK@GOTPAGE
Lloh1:
	ldr	x9, [x9, _FSL_DMA_IP_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh3:
	adrp	x9, _FSL_DMA_IP_85XX@GOTPAGE
Lloh4:
	ldr	x9, [x9, _FSL_DMA_IP_85XX@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_2
; %bb.1:
Lloh6:
	adrp	x21, _FSL_DMA_MR_CA@GOTPAGE
Lloh7:
	ldr	x21, [x21, _FSL_DMA_MR_CA@GOTPAGEOFF]
	ldr	w8, [x21]
	orr	w20, w8, w0
	mov	x0, x19
	mov	x1, x20
	bl	_set_mr
	ldr	w8, [x21]
	bic	w0, w20, w8
LBB0_2:
Lloh8:
	adrp	x8, _FSL_DMA_MR_CS@GOTPAGE
Lloh9:
	ldr	x8, [x8, _FSL_DMA_MR_CS@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	adrp	x9, _FSL_DMA_MR_EMS_EN@GOTPAGE
Lloh12:
	ldr	x9, [x9, _FSL_DMA_MR_EMS_EN@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	orr	w8, w9, w8
	bic	w1, w0, w8
	mov	x0, x19
	bl	_set_mr
	mov	w20, #100
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_dma_is_idle
	cbnz	x0, LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w0, #10
	bl	_udelay
	subs	w20, w20, #1
	b.ne	LBB0_3
; %bb.5:
	mov	x0, x19
	bl	_dma_is_idle
	cbz	x0, LBB0_7
LBB0_6:
	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
	ret
LBB0_7:
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	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	_chan_err
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_FSL_DMA_IP_MASK,4,2            ; @FSL_DMA_IP_MASK
	.comm	_FSL_DMA_IP_85XX,4,2            ; @FSL_DMA_IP_85XX
	.comm	_FSL_DMA_MR_CA,4,2              ; @FSL_DMA_MR_CA
	.comm	_FSL_DMA_MR_CS,4,2              ; @FSL_DMA_MR_CS
	.comm	_FSL_DMA_MR_EMS_EN,4,2          ; @FSL_DMA_MR_EMS_EN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DMA halt timeout!\n"

	.no_dead_strip	_dma_halt
.subsections_via_symbols
