	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i915_pageflip_stall_check
_i915_pageflip_stall_check:             ## @i915_pageflip_stall_check
	.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, %r15
	movq	8(%rdi), %rax
	movq	(%rax), %rax
	movslq	%esi, %rcx
	movq	(%rax,%rcx,8), %r13
	movq	%r13, %rdi
	callq	_to_intel_crtc
	testq	%rax, %rax
	je	LBB0_8
## %bb.1:
	movq	%rax, %r14
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	movq	8(%r14), %rbx
	testq	%rbx, %rbx
	je	LBB0_9
## %bb.2:
	leaq	12(%rbx), %rdi
	callq	_atomic_read
	movq	_INTEL_FLIP_COMPLETE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_9
## %bb.3:
	cmpl	$0, 8(%rbx)
	je	LBB0_9
## %bb.4:
	movq	(%rbx), %r12
	movq	%r15, %rdi
	callq	_INTEL_INFO
	cmpl	$4, (%rax)
	movl	(%r14), %edi
	jl	LBB0_7
## %bb.5:
	callq	_DSPSURF
	movl	%eax, %edi
	callq	_I915_READ
	movq	%rax, %rdi
	callq	_I915_HI_DISPBASE
	movq	%rax, %r13
	movq	(%r12), %rbx
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	cmpq	%rbx, %r13
	jne	LBB0_8
LBB0_6:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_DEBUG_DRIVER
	movl	(%r14), %esi
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_intel_prepare_page_flip        ## TAILCALL
LBB0_9:
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock_irqrestore         ## TAILCALL
LBB0_7:
	callq	_DSPADDR
	movl	%eax, %edi
	callq	_I915_READ
	movslq	(%r13), %rcx
	movq	8(%r13), %rdx
	movq	(%rdx), %rsi
	movslq	(%rsi), %rsi
	imulq	%rcx, %rsi
	addq	(%r12), %rsi
	movl	8(%rdx), %ecx
	imull	4(%r13), %ecx
	leal	7(%rcx), %edx
	testl	%ecx, %ecx
	cmovnsl	%ecx, %edx
	movq	%rax, %r12
	sarl	$3, %edx
	movslq	%edx, %rbx
	addq	%rsi, %rbx
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	cmpq	%rbx, %r12
	je	LBB0_6
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_INTEL_FLIP_COMPLETE,8,3        ## @INTEL_FLIP_COMPLETE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Pageflip stall detected\n"

	.no_dead_strip	_i915_pageflip_stall_check
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i915_pageflip_stall_check
_i915_pageflip_stall_check:             ; @i915_pageflip_stall_check
	.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	x8, [x0, #8]
	ldr	x8, [x8]
	ldr	x21, [x8, w1, sxtw #3]
	mov	x0, x21
	bl	_to_intel_crtc
	cbz	x0, LBB0_9
; %bb.1:
	mov	x20, x0
	mov	x0, x19
	bl	_spin_lock_irqsave
	ldr	x22, [x20, #8]
	cbz	x22, LBB0_7
; %bb.2:
	add	x0, x22, #12
	bl	_atomic_read
Lloh0:
	adrp	x8, _INTEL_FLIP_COMPLETE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _INTEL_FLIP_COMPLETE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ge	LBB0_7
; %bb.3:
	ldr	w8, [x22, #8]
	cbz	w8, LBB0_7
; %bb.4:
	ldr	x23, [x22]
	mov	x0, x19
	bl	_INTEL_INFO
	ldr	w8, [x0]
	ldr	w0, [x20]
	cmp	w8, #4
	b.lt	LBB0_8
; %bb.5:
	bl	_DSPSURF
	bl	_I915_READ
	bl	_I915_HI_DISPBASE
	mov	x21, x0
	ldr	x22, [x23]
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	cmp	x21, x22
	b.ne	LBB0_9
LBB0_6:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG_DRIVER
	ldr	w1, [x20]
	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	_intel_prepare_page_flip
LBB0_7:
	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	_spin_unlock_irqrestore
LBB0_8:
	bl	_DSPADDR
	bl	_I915_READ
	mov	x22, x0
	ldr	x8, [x23]
	ldr	x9, [x21, #8]
	ldr	x10, [x9]
	ldrsw	x10, [x10]
	ldp	w11, w12, [x21]
                                        ; kill: def $w11 killed $w11 def $x11
	sxtw	x11, w11
	madd	x8, x10, x11, x8
	ldr	w9, [x9, #8]
	mul	w9, w9, w12
	add	w10, w9, #7
	cmp	w9, #0
	csel	w9, w10, w9, lt
	asr	w9, w9, #3
	add	x21, x8, w9, sxtw
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	cmp	x22, x21
	b.eq	LBB0_6
LBB0_9:
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_INTEL_FLIP_COMPLETE,8,3        ; @INTEL_FLIP_COMPLETE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Pageflip stall detected\n"

	.no_dead_strip	_i915_pageflip_stall_check
.subsections_via_symbols
