	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mga_dma_flush                  ## -- Begin function mga_dma_flush
	.p2align	4, 0x90
_mga_dma_flush:                         ## @mga_dma_flush
	.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	%rsi, %rbx
	movq	(%rdi), %r14
	movq	%rdx, %rsi
	callq	_LOCK_TEST_WITH_RETURN
	movl	(%rbx), %eax
	movq	__DRM_LOCK_FLUSH@GOTPCREL(%rip), %r15
	movl	(%r15), %ecx
	andl	%eax, %ecx
	leaq	L_.str.2(%rip), %rdi
	leaq	L_.str.1(%rip), %rsi
	cmoveq	%rdi, %rsi
	movq	__DRM_LOCK_FLUSH_ALL@GOTPCREL(%rip), %r13
	movl	(%r13), %ecx
	andl	%eax, %ecx
	leaq	L_.str.3(%rip), %rdx
	cmoveq	%rdi, %rdx
	movq	__DRM_LOCK_QUIESCENT@GOTPCREL(%rip), %r12
	andl	(%r12), %eax
	leaq	L_.str.4(%rip), %rcx
	cmoveq	%rdi, %rcx
	leaq	L_.str(%rip), %rdi
	callq	_DRM_DEBUG
	movq	%r14, %rdi
	callq	_WRAP_WAIT_WITH_RETURN
	movl	(%rbx), %eax
	movl	(%r13), %ecx
	orl	(%r15), %ecx
	testl	%eax, %ecx
	je	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	callq	_mga_do_dma_flush
	movl	(%rbx), %eax
LBB0_2:
	testl	%eax, (%r12)
	je	LBB0_3
## %bb.4:
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mga_do_wait_for_idle           ## TAILCALL
LBB0_3:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s%s%s\n"

	.comm	__DRM_LOCK_FLUSH,4,2            ## @_DRM_LOCK_FLUSH
L_.str.1:                               ## @.str.1
	.asciz	"flush, "

L_.str.2:                               ## @.str.2
	.space	1

	.comm	__DRM_LOCK_FLUSH_ALL,4,2        ## @_DRM_LOCK_FLUSH_ALL
L_.str.3:                               ## @.str.3
	.asciz	"flush all, "

	.comm	__DRM_LOCK_QUIESCENT,4,2        ## @_DRM_LOCK_QUIESCENT
L_.str.4:                               ## @.str.4
	.asciz	"idle, "

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mga_dma_flush                  ; -- Begin function mga_dma_flush
	.p2align	2
_mga_dma_flush:                         ; @mga_dma_flush
	.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	x20, x1
	ldr	x19, [x0]
	mov	x1, x2
	bl	_LOCK_TEST_WITH_RETURN
	ldr	w8, [x20]
Lloh0:
	adrp	x22, __DRM_LOCK_FLUSH@GOTPAGE
Lloh1:
	ldr	x22, [x22, __DRM_LOCK_FLUSH@GOTPAGEOFF]
	ldr	w9, [x22]
Lloh2:
	adrp	x10, l_.str.1@PAGE
Lloh3:
	add	x10, x10, l_.str.1@PAGEOFF
Lloh4:
	adrp	x11, l_.str.2@PAGE
Lloh5:
	add	x11, x11, l_.str.2@PAGEOFF
	tst	w9, w8
	csel	x1, x11, x10, eq
Lloh6:
	adrp	x23, __DRM_LOCK_FLUSH_ALL@GOTPAGE
Lloh7:
	ldr	x23, [x23, __DRM_LOCK_FLUSH_ALL@GOTPAGEOFF]
	ldr	w9, [x23]
Lloh8:
	adrp	x10, l_.str.3@PAGE
Lloh9:
	add	x10, x10, l_.str.3@PAGEOFF
	tst	w9, w8
Lloh10:
	adrp	x21, __DRM_LOCK_QUIESCENT@GOTPAGE
Lloh11:
	ldr	x21, [x21, __DRM_LOCK_QUIESCENT@GOTPAGEOFF]
	csel	x2, x11, x10, eq
	ldr	w9, [x21]
Lloh12:
	adrp	x10, l_.str.4@PAGE
Lloh13:
	add	x10, x10, l_.str.4@PAGEOFF
	tst	w9, w8
	csel	x3, x11, x10, eq
Lloh14:
	adrp	x0, l_.str@PAGE
Lloh15:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG
	mov	x0, x19
	bl	_WRAP_WAIT_WITH_RETURN
	ldr	w8, [x20]
	ldr	w9, [x22]
	ldr	w10, [x23]
	orr	w9, w10, w9
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_mga_do_dma_flush
	ldr	w8, [x20]
LBB0_2:
	ldr	w9, [x21]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
	mov	x0, x19
	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
	b	_mga_do_wait_for_idle
LBB0_4:
	mov	w0, #0
	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 AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s%s%s\n"

	.comm	__DRM_LOCK_FLUSH,4,2            ; @_DRM_LOCK_FLUSH
l_.str.1:                               ; @.str.1
	.asciz	"flush, "

l_.str.2:                               ; @.str.2
	.space	1

	.comm	__DRM_LOCK_FLUSH_ALL,4,2        ; @_DRM_LOCK_FLUSH_ALL
l_.str.3:                               ; @.str.3
	.asciz	"flush all, "

	.comm	__DRM_LOCK_QUIESCENT,4,2        ; @_DRM_LOCK_QUIESCENT
l_.str.4:                               ; @.str.4
	.asciz	"idle, "

.subsections_via_symbols
