	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function omap_dma_stop
_omap_dma_stop:                         ## @omap_dma_stop
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movl	16(%rdi), %edi
	callq	_to_omap_dma_dev
	movq	%rax, %r14
	movq	_CICR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_omap_dma_chan_write
	movq	%r12, %rdi
	callq	_omap_dma_clear_csr
	movq	_CCR@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%r12, %rdi
	callq	_omap_dma_chan_read
	movq	(%r14), %rcx
	movq	_DMA_ERRATA_i541@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	testl	%edx, (%rcx)
	je	LBB0_5
## %bb.1:
	movq	_CCR_TRIGGER_SRC@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_5
## %bb.2:
	movq	_OCP_SYSCONFIG@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_omap_dma_glbl_read
	movq	_DMA_SYSCONFIG_MIDLEMODE_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	notl	%ebx
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	andl	%eax, %ebx
	movq	_DMA_IDLEMODE_NO_IDLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_DMA_SYSCONFIG_MIDLEMODE
	orl	%eax, %ebx
	movl	(%r15), %esi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_omap_dma_glbl_write
	movl	(%r13), %esi
	movq	%r12, %rdi
	callq	_omap_dma_chan_read
	movq	_CCR_ENABLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	notl	%edx
	andl	%eax, %edx
	movl	(%r13), %esi
	movq	%r12, %rdi
	callq	_omap_dma_chan_write
	movq	_CCR_BUFFERING_DISABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r12)
	jne	LBB0_4
## %bb.3:
	movq	%r12, %rdi
	callq	_omap_dma_drain_chan
LBB0_4:
	movq	_OCP_SYSCONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_omap_dma_glbl_write
	jmp	LBB0_9
LBB0_5:
	movq	_CCR_ENABLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%eax, %ecx
	je	LBB0_6
## %bb.7:
	notl	%ecx
	andl	%ecx, %eax
	movl	(%r13), %esi
	movq	%r12, %rdi
	movl	%eax, %edx
	callq	_omap_dma_chan_write
	movq	_CCR_BUFFERING_DISABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r12)
	jne	LBB0_9
## %bb.8:
	movq	%r12, %rdi
	callq	_omap_dma_drain_chan
LBB0_9:
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_mb
	movq	(%r14), %rax
	movl	4(%rax), %edi
	callq	___dma_omap15xx
	testl	%eax, %eax
	jne	LBB0_12
## %bb.10:
	cmpq	$0, 8(%r12)
	je	LBB0_12
## %bb.11:
	movq	_CLNK_CTRL@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%r12, %rdi
	callq	_omap_dma_chan_read
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_dma_omap1
	movl	%ebx, %ecx
	orl	$16384, %ecx                    ## imm = 0x4000
	movq	_CLNK_CTRL_ENABLE_LNK@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	notl	%edx
	andl	%ebx, %edx
	testq	%rax, %rax
	cmovnel	%ecx, %edx
	movl	(%r14), %esi
	movq	%r12, %rdi
	callq	_omap_dma_chan_write
LBB0_12:
	movl	$0, 4(%r12)
	jmp	LBB0_13
LBB0_6:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_13:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CICR,4,2                       ## @CICR
	.comm	_CCR,4,2                        ## @CCR
	.comm	_DMA_ERRATA_i541,4,2            ## @DMA_ERRATA_i541
	.comm	_CCR_TRIGGER_SRC,4,2            ## @CCR_TRIGGER_SRC
	.comm	_OCP_SYSCONFIG,4,2              ## @OCP_SYSCONFIG
	.comm	_DMA_SYSCONFIG_MIDLEMODE_MASK,4,2 ## @DMA_SYSCONFIG_MIDLEMODE_MASK
	.comm	_DMA_IDLEMODE_NO_IDLE,4,2       ## @DMA_IDLEMODE_NO_IDLE
	.comm	_CCR_ENABLE,4,2                 ## @CCR_ENABLE
	.comm	_CCR_BUFFERING_DISABLE,4,2      ## @CCR_BUFFERING_DISABLE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_CLNK_CTRL,4,2                  ## @CLNK_CTRL
	.comm	_CLNK_CTRL_ENABLE_LNK,4,2       ## @CLNK_CTRL_ENABLE_LNK
	.no_dead_strip	_omap_dma_stop
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function omap_dma_stop
_omap_dma_stop:                         ; @omap_dma_stop
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
	ldr	w0, [x0, #16]
	bl	_to_omap_dma_dev
	mov	x20, x0
Lloh0:
	adrp	x8, _CICR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CICR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_omap_dma_chan_write
	mov	x0, x19
	bl	_omap_dma_clear_csr
Lloh3:
	adrp	x22, _CCR@GOTPAGE
Lloh4:
	ldr	x22, [x22, _CCR@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_omap_dma_chan_read
	ldr	x8, [x20]
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _DMA_ERRATA_i541@GOTPAGE
Lloh6:
	ldr	x9, [x9, _DMA_ERRATA_i541@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.1:
Lloh8:
	adrp	x8, _CCR_TRIGGER_SRC@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CCR_TRIGGER_SRC@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_5
; %bb.2:
Lloh11:
	adrp	x23, _OCP_SYSCONFIG@GOTPAGE
Lloh12:
	ldr	x23, [x23, _OCP_SYSCONFIG@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x20
	bl	_omap_dma_glbl_read
	mov	x21, x0
Lloh13:
	adrp	x8, _DMA_SYSCONFIG_MIDLEMODE_MASK@GOTPAGE
Lloh14:
	ldr	x8, [x8, _DMA_SYSCONFIG_MIDLEMODE_MASK@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	bic	w24, w0, w8
Lloh16:
	adrp	x8, _DMA_IDLEMODE_NO_IDLE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _DMA_IDLEMODE_NO_IDLE@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	bl	_DMA_SYSCONFIG_MIDLEMODE
	orr	w2, w0, w24
	ldr	w1, [x23]
	mov	x0, x20
	bl	_omap_dma_glbl_write
	ldr	w1, [x22]
	mov	x0, x19
	bl	_omap_dma_chan_read
Lloh19:
	adrp	x8, _CCR_ENABLE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _CCR_ENABLE@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	bic	w2, w0, w8
	ldr	w1, [x22]
	mov	x0, x19
	bl	_omap_dma_chan_write
	ldr	w8, [x19]
Lloh22:
	adrp	x9, _CCR_BUFFERING_DISABLE@GOTPAGE
Lloh23:
	ldr	x9, [x9, _CCR_BUFFERING_DISABLE@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_omap_dma_drain_chan
LBB0_4:
	ldr	w1, [x23]
	mov	x0, x20
	mov	x2, x21
	bl	_omap_dma_glbl_write
	b	LBB0_8
LBB0_5:
Lloh25:
	adrp	x8, _CCR_ENABLE@GOTPAGE
Lloh26:
	ldr	x8, [x8, _CCR_ENABLE@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_12
; %bb.6:
	bic	w2, w0, w8
	ldr	w1, [x22]
	mov	x0, x19
	bl	_omap_dma_chan_write
	ldr	w8, [x19]
Lloh28:
	adrp	x9, _CCR_BUFFERING_DISABLE@GOTPAGE
Lloh29:
	ldr	x9, [x9, _CCR_BUFFERING_DISABLE@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_8
; %bb.7:
	mov	x0, x19
	bl	_omap_dma_drain_chan
LBB0_8:
	bl	_mb
	ldr	x8, [x20]
	ldr	w0, [x8, #4]
	bl	___dma_omap15xx
	cbnz	w0, LBB0_11
; %bb.9:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_11
; %bb.10:
Lloh31:
	adrp	x21, _CLNK_CTRL@GOTPAGE
Lloh32:
	ldr	x21, [x21, _CLNK_CTRL@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_omap_dma_chan_read
	mov	x20, x0
	bl	_dma_omap1
Lloh33:
	adrp	x8, _CLNK_CTRL_ENABLE_LNK@GOTPAGE
Lloh34:
	ldr	x8, [x8, _CLNK_CTRL_ENABLE_LNK@GOTPAGEOFF]
	orr	w9, w20, #0x4000
Lloh35:
	ldr	w8, [x8]
	bic	w8, w20, w8
	cmp	x0, #0
	csel	w2, w8, w9, eq
	ldr	w1, [x21]
	mov	x0, x19
	bl	_omap_dma_chan_write
LBB0_11:
	mov	w0, #0
	str	wzr, [x19, #4]
	b	LBB0_13
LBB0_12:
Lloh36:
	adrp	x8, _EINVAL@GOTPAGE
Lloh37:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh38:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_13:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_CICR,4,2                       ; @CICR
	.comm	_CCR,4,2                        ; @CCR
	.comm	_DMA_ERRATA_i541,4,2            ; @DMA_ERRATA_i541
	.comm	_CCR_TRIGGER_SRC,4,2            ; @CCR_TRIGGER_SRC
	.comm	_OCP_SYSCONFIG,4,2              ; @OCP_SYSCONFIG
	.comm	_DMA_SYSCONFIG_MIDLEMODE_MASK,4,2 ; @DMA_SYSCONFIG_MIDLEMODE_MASK
	.comm	_DMA_IDLEMODE_NO_IDLE,4,2       ; @DMA_IDLEMODE_NO_IDLE
	.comm	_CCR_ENABLE,4,2                 ; @CCR_ENABLE
	.comm	_CCR_BUFFERING_DISABLE,4,2      ; @CCR_BUFFERING_DISABLE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_CLNK_CTRL,4,2                  ; @CLNK_CTRL
	.comm	_CLNK_CTRL_ENABLE_LNK,4,2       ; @CLNK_CTRL_ENABLE_LNK
	.no_dead_strip	_omap_dma_stop
.subsections_via_symbols
