	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_prepare_plane_fb         ## -- Begin function intel_prepare_plane_fb
	.p2align	4, 0x90
_intel_prepare_plane_fb:                ## @intel_prepare_plane_fb
	.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, %r13
	movq	%rdi, %rbx
	movl	24(%rsi), %edi
	callq	_to_intel_atomic_state
	movq	%rax, %r15
	movl	8(%rbx), %edi
	callq	_to_i915
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	16(%r13), %rdi
	callq	_intel_fb_obj
	movq	%rax, %r12
	movq	(%rbx), %rax
	movq	8(%rax), %rdi
	callq	_intel_fb_obj
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	%rax, %r14
	movq	(%rbx), %rax
	movl	(%rax), %edi
	callq	_to_intel_crtc
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_intel_atomic_get_new_crtc_state
	movq	%rax, %rdi
	callq	_needs_modeset
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	leaq	4(%r15), %rdi
	movl	(%r14), %esi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_i915_sw_fence_await_reservation
	testl	%eax, %eax
	js	LBB0_10
LBB0_3:
	movq	(%r13), %rsi
	testq	%rsi, %rsi
	je	LBB0_5
## %bb.4:
	leaq	4(%r15), %rdi
	movq	_I915_FENCE_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_i915_sw_fence_await_dma_fence
	testl	%eax, %eax
	js	LBB0_10
LBB0_5:
	testq	%r12, %r12
	je	LBB0_16
## %bb.6:
	movq	%r12, %rdi
	callq	_i915_gem_object_pin_pages
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_17
## %bb.7:
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_mutex_lock_interruptible
	testl	%eax, %eax
	je	LBB0_11
## %bb.8:
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_i915_gem_object_unpin_pages
	jmp	LBB0_17
LBB0_11:
	movq	%r13, %rdi
	callq	_to_intel_plane_state
	movl	%eax, %edi
	callq	_intel_plane_pin_fb
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	%r12, %rdi
	callq	_i915_gem_object_unpin_pages
	testl	%ebx, %ebx
	jne	LBB0_17
## %bb.12:
	movq	%r12, %rdi
	callq	_fb_obj_bump_render_priority
	movl	4(%r12), %edi
	movq	_ORIGIN_DIRTYFB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_intel_frontbuffer_flush
	movq	(%r13), %rsi
	testq	%rsi, %rsi
	je	LBB0_18
## %bb.13:
	movl	8(%r13), %edi
	callq	_add_rps_boost_after_vblank
	movq	-48(%rbp), %r14                 ## 8-byte Reload
LBB0_14:
	cmpl	$0, (%r15)
	jne	LBB0_16
## %bb.15:
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_intel_rps_mark_interactive
	movl	$1, (%r15)
LBB0_16:
	xorl	%ebx, %ebx
	jmp	LBB0_17
LBB0_18:
	movq	%r15, %rdi
	addq	$4, %rdi
	movl	(%r12), %esi
	movq	_I915_FENCE_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_i915_sw_fence_await_reservation
	testl	%eax, %eax
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	js	LBB0_10
## %bb.19:
	movl	(%r12), %edi
	callq	_dma_resv_get_excl_rcu
	testq	%rax, %rax
	je	LBB0_14
## %bb.20:
	movq	%rax, %rbx
	movl	8(%r13), %edi
	movq	%rax, %rsi
	callq	_add_rps_boost_after_vblank
	movq	%rbx, %rdi
	callq	_dma_fence_put
	jmp	LBB0_14
LBB0_10:
	movl	%eax, %ebx
LBB0_17:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_I915_FENCE_TIMEOUT,4,2         ## @I915_FENCE_TIMEOUT
	.comm	_ORIGIN_DIRTYFB,4,2             ## @ORIGIN_DIRTYFB
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_prepare_plane_fb         ; -- Begin function intel_prepare_plane_fb
	.p2align	2
_intel_prepare_plane_fb:                ; @intel_prepare_plane_fb
	.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	x21, x1
	mov	x23, x0
	ldr	w0, [x1, #24]
	bl	_to_intel_atomic_state
	mov	x19, x0
	ldr	w0, [x23, #8]
	bl	_to_i915
	mov	x20, x0
	ldr	x0, [x21, #16]
	bl	_intel_fb_obj
	mov	x22, x0
	ldr	x8, [x23]
	ldr	x0, [x8, #8]
	bl	_intel_fb_obj
	cbz	x0, LBB0_3
; %bb.1:
	mov	x24, x0
	ldr	x8, [x23]
	ldr	w0, [x8]
	bl	_to_intel_crtc
	mov	x1, x0
	mov	x0, x19
	bl	_intel_atomic_get_new_crtc_state
	bl	_needs_modeset
	cbz	x0, LBB0_3
; %bb.2:
	add	x0, x19, #4
	ldr	w1, [x24]
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w5, [x8]
	mov	x2, #0
	mov	w3, #0
	mov	w4, #0
	bl	_i915_sw_fence_await_reservation
	tbnz	w0, #31, LBB0_17
LBB0_3:
	ldr	x1, [x21]
	cbz	x1, LBB0_5
; %bb.4:
	add	x0, x19, #4
Lloh3:
	adrp	x8, _I915_FENCE_TIMEOUT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _I915_FENCE_TIMEOUT@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
Lloh6:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh8:
	ldr	w3, [x8]
	bl	_i915_sw_fence_await_dma_fence
	tbnz	w0, #31, LBB0_17
LBB0_5:
	cbz	x22, LBB0_13
; %bb.6:
	mov	x0, x22
	bl	_i915_gem_object_pin_pages
	mov	x23, x0
	cbnz	w0, LBB0_18
; %bb.7:
	mov	x0, x20
	bl	_mutex_lock_interruptible
	cbz	w0, LBB0_9
; %bb.8:
	mov	x23, x0
	mov	x0, x22
	bl	_i915_gem_object_unpin_pages
	b	LBB0_18
LBB0_9:
	mov	x0, x21
	bl	_to_intel_plane_state
	bl	_intel_plane_pin_fb
	mov	x23, x0
	mov	x0, x20
	bl	_mutex_unlock
	mov	x0, x22
	bl	_i915_gem_object_unpin_pages
	cbnz	w23, LBB0_18
; %bb.10:
	mov	x0, x22
	bl	_fb_obj_bump_render_priority
	ldr	w0, [x22, #4]
Lloh9:
	adrp	x8, _ORIGIN_DIRTYFB@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ORIGIN_DIRTYFB@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	bl	_intel_frontbuffer_flush
	ldr	x1, [x21]
	cbz	x1, LBB0_14
; %bb.11:
	ldr	w0, [x21, #8]
	bl	_add_rps_boost_after_vblank
LBB0_12:
	ldr	w8, [x19]
	cbz	w8, LBB0_19
LBB0_13:
	mov	w23, #0
	b	LBB0_18
LBB0_14:
	add	x0, x19, #4
	ldr	w1, [x22]
Lloh12:
	adrp	x8, _I915_FENCE_TIMEOUT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _I915_FENCE_TIMEOUT@GOTPAGEOFF]
Lloh14:
	ldr	w4, [x8]
Lloh15:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh17:
	ldr	w5, [x8]
	mov	x2, #0
	mov	w3, #0
	bl	_i915_sw_fence_await_reservation
	tbnz	w0, #31, LBB0_17
; %bb.15:
	ldr	w0, [x22]
	bl	_dma_resv_get_excl_rcu
	cbz	x0, LBB0_12
; %bb.16:
	mov	x22, x0
	ldr	w0, [x21, #8]
	mov	x1, x22
	bl	_add_rps_boost_after_vblank
	mov	x0, x22
	bl	_dma_fence_put
	b	LBB0_12
LBB0_17:
	mov	x23, x0
LBB0_18:
	mov	x0, x23
	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
LBB0_19:
	mov	w21, #1
	mov	x0, x20
	mov	w1, #1
	bl	_intel_rps_mark_interactive
	mov	w23, #0
	str	w21, [x19]
	b	LBB0_18
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_I915_FENCE_TIMEOUT,4,2         ; @I915_FENCE_TIMEOUT
	.comm	_ORIGIN_DIRTYFB,4,2             ; @ORIGIN_DIRTYFB
.subsections_via_symbols
