	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i810_flush_queue
_i810_flush_queue:                      ## @i810_flush_queue
	.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, %rbx
	movq	(%rdi), %r12
	movq	8(%rdi), %r14
	callq	_i810_kernel_lost_context
	movl	$2, %edi
	callq	_BEGIN_LP_RING
	movq	_CMD_REPORT_HEAD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_OUT_RING
	xorl	%edi, %edi
	callq	_OUT_RING
	xorl	%eax, %eax
	callq	_ADVANCE_LP_RING
	movq	(%r14), %rsi
	addq	$-8, %rsi
	movq	%rbx, %rdi
	callq	_i810_wait_ring
	cmpl	$0, (%r12)
	jle	LBB0_7
## %bb.1:
	xorl	%ebx, %ebx
	movq	_I810_BUF_HARDWARE@GOTPCREL(%rip), %r14
	movq	_I810_BUF_CLIENT@GOTPCREL(%rip), %r15
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%rbx
	movslq	(%r12), %rax
	cmpq	%rax, %rbx
	jge	LBB0_7
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %rax
	movq	(%rax,%rbx,8), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	movl	(%r14), %esi
	movq	_I810_BUF_FREE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_cmpxchg
	movl	%eax, %r13d
	cmpl	(%r14), %eax
	jne	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str(%rip), %rdi
	callq	_DRM_DEBUG
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	cmpl	(%r15), %r13d
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_DEBUG
	jmp	LBB0_6
LBB0_7:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RING_LOCALS,4,2                ## @RING_LOCALS
	.comm	_CMD_REPORT_HEAD,4,2            ## @CMD_REPORT_HEAD
	.comm	_I810_BUF_HARDWARE,4,2          ## @I810_BUF_HARDWARE
	.comm	_I810_BUF_FREE,4,2              ## @I810_BUF_FREE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"reclaimed from HARDWARE\n"

	.comm	_I810_BUF_CLIENT,4,2            ## @I810_BUF_CLIENT
L_.str.1:                               ## @.str.1
	.asciz	"still on client\n"

	.no_dead_strip	_i810_flush_queue
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i810_flush_queue
_i810_flush_queue:                      ; @i810_flush_queue
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
	ldp	x22, x20, [x0]
	bl	_i810_kernel_lost_context
	mov	w0, #2
	bl	_BEGIN_LP_RING
Lloh0:
	adrp	x8, _CMD_REPORT_HEAD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CMD_REPORT_HEAD@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_OUT_RING
	mov	w0, #0
	bl	_OUT_RING
	bl	_ADVANCE_LP_RING
	ldr	x8, [x20]
	sub	x1, x8, #8
	mov	x0, x19
	bl	_i810_wait_ring
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.1:
	mov	x23, #0
Lloh3:
	adrp	x24, _I810_BUF_HARDWARE@GOTPAGE
Lloh4:
	ldr	x24, [x24, _I810_BUF_HARDWARE@GOTPAGEOFF]
Lloh5:
	adrp	x25, _I810_BUF_FREE@GOTPAGE
Lloh6:
	ldr	x25, [x25, _I810_BUF_FREE@GOTPAGEOFF]
Lloh7:
	adrp	x19, l_.str@PAGE
Lloh8:
	add	x19, x19, l_.str@PAGEOFF
Lloh9:
	adrp	x26, _I810_BUF_CLIENT@GOTPAGE
Lloh10:
	ldr	x26, [x26, _I810_BUF_CLIENT@GOTPAGEOFF]
Lloh11:
	adrp	x20, l_.str.1@PAGE
Lloh12:
	add	x20, x20, l_.str.1@PAGEOFF
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x23, x23, #1
	ldrsw	x8, [x22]
	cmp	x23, x8
	b.ge	LBB0_7
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x22, #8]
	ldr	x8, [x8, x23, lsl #3]
	ldr	x8, [x8]
	ldr	w0, [x8]
	ldr	w1, [x24]
	ldr	w2, [x25]
	bl	_cmpxchg
	mov	x21, x0
	ldr	w8, [x24]
	cmp	w0, w8
	b.ne	LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	bl	_DRM_DEBUG
LBB0_5:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x26]
	cmp	w21, w8
	b.ne	LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x20
	bl	_DRM_DEBUG
	b	LBB0_2
LBB0_7:
	mov	w0, #0
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_RING_LOCALS,4,2                ; @RING_LOCALS
	.comm	_CMD_REPORT_HEAD,4,2            ; @CMD_REPORT_HEAD
	.comm	_I810_BUF_HARDWARE,4,2          ; @I810_BUF_HARDWARE
	.comm	_I810_BUF_FREE,4,2              ; @I810_BUF_FREE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"reclaimed from HARDWARE\n"

	.comm	_I810_BUF_CLIENT,4,2            ; @I810_BUF_CLIENT
l_.str.1:                               ; @.str.1
	.asciz	"still on client\n"

	.no_dead_strip	_i810_flush_queue
.subsections_via_symbols
