	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_pin_and_fence_fb_obj     ## -- Begin function intel_pin_and_fence_fb_obj
	.p2align	4, 0x90
_intel_pin_and_fence_fb_obj:            ## @intel_pin_and_fence_fb_obj
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movl	%edx, -48(%rbp)                 ## 4-byte Spill
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r15
	movq	(%rdi), %rbx
	movq	%rbx, %rdi
	callq	_to_i915
	movq	%rax, %r12
	movq	%r15, %rdi
	callq	_intel_fb_obj
	movq	%rax, %r13
	movq	%rbx, %rdi
	callq	_mutex_is_locked
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_WARN_ON
	xorl	%r14d, %r14d
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_intel_surf_alignment
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_intel_scanout_needs_vtd_wa
	cmpl	$262144, %ebx                   ## imm = 0x40000
	movl	$262144, %r15d                  ## imm = 0x40000
	cmovgel	%ebx, %r15d
	testq	%rax, %rax
	cmovel	%ebx, %r15d
	movq	%r13, %rbx
	movq	%r12, %rdi
	callq	_intel_runtime_pm_get
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%r13, %rdi
	callq	_i915_gem_object_lock
	leaq	4(%r12), %r13
	movq	%r13, %rdi
	callq	_atomic_inc
	movq	%r12, %rdi
	callq	_HAS_GMCH
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_PIN_MAPPABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
LBB0_2:
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movl	%r14d, %ecx
	callq	_i915_gem_object_pin_to_display_plane
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	jne	LBB0_11
## %bb.3:
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_10
## %bb.4:
	movq	%r14, %rdi
	callq	_i915_vma_is_map_and_fenceable
	testq	%rax, %rax
	je	LBB0_10
## %bb.5:
	movq	%r14, %rdi
	callq	_i915_vma_pin_fence
	testl	%eax, %eax
	je	LBB0_8
## %bb.6:
	movl	%eax, %r15d
	movq	%r12, %rdi
	callq	_INTEL_GEN
	cmpl	$4, %eax
	jge	LBB0_10
## %bb.7:
	movq	%r14, %rdi
	callq	_i915_gem_object_unpin_from_display_plane
	movl	%r15d, %edi
	callq	_ERR_PTR
	movq	%rax, %r14
	jmp	LBB0_11
LBB0_8:
	cmpq	$0, (%r14)
	je	LBB0_10
## %bb.9:
	movq	_PLANE_HAS_FENCE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	orq	%rax, (%rcx)
LBB0_10:
	movq	%r14, %rdi
	callq	_i915_vma_get
LBB0_11:
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movq	%r13, %rdi
	callq	_atomic_dec
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_i915_gem_object_unlock
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_intel_runtime_pm_put
	movq	%r14, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PIN_MAPPABLE,4,2               ## @PIN_MAPPABLE
	.comm	_PLANE_HAS_FENCE,8,3            ## @PLANE_HAS_FENCE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_pin_and_fence_fb_obj     ; -- Begin function intel_pin_and_fence_fb_obj
	.p2align	2
_intel_pin_and_fence_fb_obj:            ; @intel_pin_and_fence_fb_obj
	.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	x21, x3
	mov	x24, x2
	mov	x25, x1
	mov	x22, x0
	ldr	x23, [x0]
	mov	x0, x23
	bl	_to_i915
	mov	x19, x0
	mov	x0, x22
	bl	_intel_fb_obj
	mov	x20, x0
	mov	x0, x23
	bl	_mutex_is_locked
	cmp	w0, #0
	cset	w0, eq
	bl	_WARN_ON
	mov	x0, x22
	mov	w1, #0
	bl	_intel_surf_alignment
	mov	x22, x0
	mov	x0, x19
	bl	_intel_scanout_needs_vtd_wa
	cmp	w22, #64, lsl #12               ; =262144
	ccmp	x0, #0, #4, lt
	mov	w8, #262144
	csel	w26, w8, w22, ne
	mov	x0, x19
	bl	_intel_runtime_pm_get
	mov	x22, x0
	mov	x0, x20
	bl	_i915_gem_object_lock
	add	x23, x19, #4
	mov	x0, x23
	bl	_atomic_inc
	mov	x0, x19
	bl	_HAS_GMCH
Lloh0:
	adrp	x8, _PIN_MAPPABLE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PIN_MAPPABLE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	x0, #0
	csel	w3, wzr, w8, eq
	mov	x0, x20
	mov	x1, x26
	mov	x2, x25
	bl	_i915_gem_object_pin_to_display_plane
	mov	x25, x0
	bl	_IS_ERR
	cbnz	x0, LBB0_9
; %bb.1:
	cbz	w24, LBB0_8
; %bb.2:
	mov	x0, x25
	bl	_i915_vma_is_map_and_fenceable
	cbz	x0, LBB0_8
; %bb.3:
	mov	x0, x25
	bl	_i915_vma_pin_fence
	cbz	w0, LBB0_6
; %bb.4:
	mov	x24, x0
	mov	x0, x19
	bl	_INTEL_GEN
	cmp	w0, #4
	b.ge	LBB0_8
; %bb.5:
	mov	x0, x25
	bl	_i915_gem_object_unpin_from_display_plane
	mov	x0, x24
	bl	_ERR_PTR
	mov	x25, x0
	b	LBB0_9
LBB0_6:
	ldr	x8, [x25]
	cbz	x8, LBB0_8
; %bb.7:
Lloh3:
	adrp	x8, _PLANE_HAS_FENCE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PLANE_HAS_FENCE@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ldr	x9, [x21]
	orr	x8, x9, x8
	str	x8, [x21]
LBB0_8:
	mov	x0, x25
	bl	_i915_vma_get
LBB0_9:
	mov	x0, x23
	bl	_atomic_dec
	mov	x0, x20
	bl	_i915_gem_object_unlock
	mov	x0, x19
	mov	x1, x22
	bl	_intel_runtime_pm_put
	mov	x0, x25
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_PIN_MAPPABLE,4,2               ; @PIN_MAPPABLE
	.comm	_PLANE_HAS_FENCE,8,3            ; @PLANE_HAS_FENCE
.subsections_via_symbols
