	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i915_gem_object_prepare_write  ## -- Begin function i915_gem_object_prepare_write
	.p2align	4, 0x90
_i915_gem_object_prepare_write:         ## @i915_gem_object_prepare_write
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	movl	$0, (%rsi)
	callq	_i915_gem_object_has_struct_page
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	%r15, %rdi
	callq	_i915_gem_object_lock_interruptible
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_14
## %bb.3:
	movq	_I915_WAIT_INTERRUPTIBLE@GOTPCREL(%rip), %rax
	movq	_I915_WAIT_ALL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	_MAX_SCHEDULE_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_i915_gem_object_wait
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_9
## %bb.4:
	movq	%r15, %rdi
	callq	_i915_gem_object_pin_pages
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_9
## %bb.5:
	movq	_I915_BO_CACHE_COHERENT_FOR_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_6
LBB0_7:
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_i915_gem_object_set_to_cpu_domain
	testl	%eax, %eax
	je	LBB0_13
## %bb.8:
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_i915_gem_object_unpin_pages
LBB0_9:
	movq	%r15, %rdi
	callq	_i915_gem_object_unlock
	jmp	LBB0_14
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_14:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_X86_FEATURE_CLFLUSH@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_static_cpu_has
	testl	%eax, %eax
	je	LBB0_7
## %bb.10:
	movq	_I915_GEM_DOMAIN_CPU@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	notl	%esi
	movq	%r15, %rdi
	callq	_i915_gem_object_flush_write_domain
	cmpl	$0, 16(%r15)
	jne	LBB0_13
## %bb.11:
	movq	_CLFLUSH_AFTER@GOTPCREL(%rip), %rcx
	movl	(%r14), %eax
	orl	(%rcx), %eax
	movl	%eax, (%r14)
	movl	(%rbx), %ecx
	testl	%ecx, 4(%r15)
	jne	LBB0_13
## %bb.12:
	movq	_CLFLUSH_BEFORE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, (%r14)
LBB0_13:
	movl	12(%r15), %edi
	movq	_ORIGIN_CPU@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_intel_frontbuffer_invalidate
	movl	$1, 8(%r15)
	xorl	%ebx, %ebx
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_I915_WAIT_INTERRUPTIBLE,4,2    ## @I915_WAIT_INTERRUPTIBLE
	.comm	_I915_WAIT_ALL,4,2              ## @I915_WAIT_ALL
	.comm	_MAX_SCHEDULE_TIMEOUT,4,2       ## @MAX_SCHEDULE_TIMEOUT
	.comm	_I915_BO_CACHE_COHERENT_FOR_WRITE,4,2 ## @I915_BO_CACHE_COHERENT_FOR_WRITE
	.comm	_X86_FEATURE_CLFLUSH,4,2        ## @X86_FEATURE_CLFLUSH
	.comm	_I915_GEM_DOMAIN_CPU,4,2        ## @I915_GEM_DOMAIN_CPU
	.comm	_CLFLUSH_AFTER,4,2              ## @CLFLUSH_AFTER
	.comm	_CLFLUSH_BEFORE,4,2             ## @CLFLUSH_BEFORE
	.comm	_ORIGIN_CPU,4,2                 ## @ORIGIN_CPU
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i915_gem_object_prepare_write  ; -- Begin function i915_gem_object_prepare_write
	.p2align	2
_i915_gem_object_prepare_write:         ; @i915_gem_object_prepare_write
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x1
	mov	x19, x0
	str	wzr, [x1]
	bl	_i915_gem_object_has_struct_page
	cbz	w0, LBB0_8
; %bb.1:
	mov	x0, x19
	bl	_i915_gem_object_lock_interruptible
	mov	x21, x0
	cbnz	w0, LBB0_9
; %bb.2:
Lloh0:
	adrp	x8, _I915_WAIT_INTERRUPTIBLE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _I915_WAIT_INTERRUPTIBLE@GOTPAGEOFF]
Lloh2:
	adrp	x9, _I915_WAIT_ALL@GOTPAGE
Lloh3:
	ldr	x9, [x9, _I915_WAIT_ALL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	ldr	w9, [x9]
	orr	w1, w9, w8
Lloh6:
	adrp	x8, _MAX_SCHEDULE_TIMEOUT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MAX_SCHEDULE_TIMEOUT@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_i915_gem_object_wait
	mov	x21, x0
	cbnz	w0, LBB0_7
; %bb.3:
	mov	x0, x19
	bl	_i915_gem_object_pin_pages
	mov	x21, x0
	cbnz	w0, LBB0_7
; %bb.4:
	ldr	w8, [x19]
Lloh9:
	adrp	x9, _I915_BO_CACHE_COHERENT_FOR_WRITE@GOTPAGE
Lloh10:
	ldr	x9, [x9, _I915_BO_CACHE_COHERENT_FOR_WRITE@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
LBB0_5:
	mov	x0, x19
	mov	w1, #1
	bl	_i915_gem_object_set_to_cpu_domain
	cbz	w0, LBB0_14
; %bb.6:
	mov	x21, x0
	mov	x0, x19
	bl	_i915_gem_object_unpin_pages
LBB0_7:
	mov	x0, x19
	bl	_i915_gem_object_unlock
	b	LBB0_9
LBB0_8:
Lloh12:
	adrp	x8, _ENODEV@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_9:
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_10:
Lloh15:
	adrp	x8, _X86_FEATURE_CLFLUSH@GOTPAGE
Lloh16:
	ldr	x8, [x8, _X86_FEATURE_CLFLUSH@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	bl	_static_cpu_has
	cbz	w0, LBB0_5
; %bb.11:
Lloh18:
	adrp	x21, _I915_GEM_DOMAIN_CPU@GOTPAGE
Lloh19:
	ldr	x21, [x21, _I915_GEM_DOMAIN_CPU@GOTPAGEOFF]
	ldr	w8, [x21]
	mvn	w1, w8
	mov	x0, x19
	bl	_i915_gem_object_flush_write_domain
	ldr	w8, [x19, #16]
	cbnz	w8, LBB0_14
; %bb.12:
Lloh20:
	adrp	x8, _CLFLUSH_AFTER@GOTPAGE
Lloh21:
	ldr	x8, [x8, _CLFLUSH_AFTER@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	ldr	w9, [x20]
	orr	w8, w9, w8
	str	w8, [x20]
	ldr	w9, [x19, #4]
	ldr	w10, [x21]
	tst	w10, w9
	b.ne	LBB0_14
; %bb.13:
Lloh23:
	adrp	x9, _CLFLUSH_BEFORE@GOTPAGE
Lloh24:
	ldr	x9, [x9, _CLFLUSH_BEFORE@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x20]
LBB0_14:
	ldr	w0, [x19, #12]
Lloh26:
	adrp	x8, _ORIGIN_CPU@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ORIGIN_CPU@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	bl	_intel_frontbuffer_invalidate
	mov	w21, #0
	mov	w8, #1
	str	w8, [x19, #8]
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_I915_WAIT_INTERRUPTIBLE,4,2    ; @I915_WAIT_INTERRUPTIBLE
	.comm	_I915_WAIT_ALL,4,2              ; @I915_WAIT_ALL
	.comm	_MAX_SCHEDULE_TIMEOUT,4,2       ; @MAX_SCHEDULE_TIMEOUT
	.comm	_I915_BO_CACHE_COHERENT_FOR_WRITE,4,2 ; @I915_BO_CACHE_COHERENT_FOR_WRITE
	.comm	_X86_FEATURE_CLFLUSH,4,2        ; @X86_FEATURE_CLFLUSH
	.comm	_I915_GEM_DOMAIN_CPU,4,2        ; @I915_GEM_DOMAIN_CPU
	.comm	_CLFLUSH_AFTER,4,2              ; @CLFLUSH_AFTER
	.comm	_CLFLUSH_BEFORE,4,2             ; @CLFLUSH_BEFORE
	.comm	_ORIGIN_CPU,4,2                 ; @ORIGIN_CPU
.subsections_via_symbols
