	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i915_kernel_lost_context       ## -- Begin function i915_kernel_lost_context
	.p2align	4, 0x90
_i915_kernel_lost_context:              ## @i915_kernel_lost_context
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movq	8(%rdi), %rdi
	callq	_LP_RING
	movq	%rax, %rbx
	movq	_DRIVER_MODESET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_drm_core_check_feature
	testq	%rax, %rax
	je	LBB0_1
LBB0_7:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_1:
	movq	%rbx, %rdi
	callq	_I915_READ_HEAD
	movq	_HEAD_ADDR@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movl	%eax, (%rbx)
	movq	%rbx, %rdi
	callq	_I915_READ_TAIL
	movq	_TAIL_ADDR@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movslq	%eax, %rsi
	movl	%esi, 4(%rbx)
	movslq	(%rbx), %rcx
	movq	_I915_RING_FREE_SPACE@GOTPCREL(%rip), %rdx
	addq	(%rdx), %rsi
	movq	%rcx, %rdx
	subq	%rsi, %rdx
	movq	%rdx, 8(%rbx)
	jns	LBB0_3
## %bb.2:
	addq	16(%rbx), %rdx
	movq	%rdx, 8(%rbx)
LBB0_3:
	movq	(%r14), %rdx
	movq	(%rdx), %rdx
	testq	%rdx, %rdx
	je	LBB0_7
## %bb.4:
	cmpl	%eax, %ecx
	jne	LBB0_7
## %bb.5:
	movq	(%rdx), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	_I915_BOX_RING_EMPTY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%ecx, (%rax)
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_DRIVER_MODESET,4,2             ## @DRIVER_MODESET
	.comm	_HEAD_ADDR,4,2                  ## @HEAD_ADDR
	.comm	_TAIL_ADDR,4,2                  ## @TAIL_ADDR
	.comm	_I915_RING_FREE_SPACE,8,3       ## @I915_RING_FREE_SPACE
	.comm	_I915_BOX_RING_EMPTY,4,2        ## @I915_BOX_RING_EMPTY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i915_kernel_lost_context       ; -- Begin function i915_kernel_lost_context
	.p2align	2
_i915_kernel_lost_context:              ; @i915_kernel_lost_context
	.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
	ldr	x0, [x0, #8]
	bl	_LP_RING
	mov	x20, x0
Lloh0:
	adrp	x8, _DRIVER_MODESET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DRIVER_MODESET@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_drm_core_check_feature
	cbnz	x0, LBB0_6
; %bb.1:
	mov	x0, x20
	bl	_I915_READ_HEAD
Lloh3:
	adrp	x8, _HEAD_ADDR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HEAD_ADDR@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	and	w8, w8, w0
	str	w8, [x20]
	mov	x0, x20
	bl	_I915_READ_TAIL
Lloh6:
	adrp	x8, _TAIL_ADDR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _TAIL_ADDR@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	and	w8, w8, w0
	str	w8, [x20, #4]
	ldrsw	x9, [x20]
Lloh9:
	adrp	x10, _I915_RING_FREE_SPACE@GOTPAGE
Lloh10:
	ldr	x10, [x10, _I915_RING_FREE_SPACE@GOTPAGEOFF]
Lloh11:
	ldr	x10, [x10]
	add	x10, x10, w8, sxtw
	subs	x10, x9, x10
	str	x10, [x20, #8]
	b.pl	LBB0_3
; %bb.2:
	ldr	x11, [x20, #16]
	add	x10, x11, x10
	str	x10, [x20, #8]
LBB0_3:
	ldr	x10, [x19]
	ldr	x10, [x10]
	cmp	x10, #0
	ccmp	w9, w8, #0, ne
	b.ne	LBB0_6
; %bb.4:
	ldr	x8, [x10]
	ldr	x8, [x8]
	cbz	x8, LBB0_6
; %bb.5:
Lloh12:
	adrp	x9, _I915_BOX_RING_EMPTY@GOTPAGE
Lloh13:
	ldr	x9, [x9, _I915_BOX_RING_EMPTY@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	ldr	w10, [x8]
	orr	w9, w10, w9
	str	w9, [x8]
LBB0_6:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_DRIVER_MODESET,4,2             ; @DRIVER_MODESET
	.comm	_HEAD_ADDR,4,2                  ; @HEAD_ADDR
	.comm	_TAIL_ADDR,4,2                  ; @TAIL_ADDR
	.comm	_I915_RING_FREE_SPACE,8,3       ; @I915_RING_FREE_SPACE
	.comm	_I915_BOX_RING_EMPTY,4,2        ; @I915_BOX_RING_EMPTY
.subsections_via_symbols
