	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function intel_crtc_cursor_set
_intel_crtc_cursor_set:                 ## @intel_crtc_cursor_set
	.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
	movl	%r8d, -52(%rbp)                 ## 4-byte Spill
	movl	%ecx, %r12d
	movl	%edx, %r15d
	movq	%rsi, %r13
	movq	%rdi, %r14
	movq	(%rdi), %rbx
	movq	8(%rbx), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	callq	_to_intel_crtc
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	testl	%r15d, %r15d
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_1
## %bb.2:
	cmpl	$64, %r12d
	jne	LBB0_4
## %bb.3:
	cmpl	$64, -52(%rbp)                  ## 4-byte Folded Reload
	jne	LBB0_4
## %bb.5:
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	movq	%r13, %rsi
	movl	%r15d, %edx
	callq	_drm_gem_object_lookup
	movl	%eax, %edi
	callq	_to_intel_bo
	movq	%rax, %r15
	cmpl	$16383, 4(%rax)                 ## imm = 0x3FFF
	jg	LBB0_7
## %bb.6:
	leaq	L_.str.2(%rip), %rdi
	callq	_DRM_ERROR
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_32
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_DEBUG_KMS
	movq	%rbx, %rdi
	callq	_mutex_lock
	xorl	%r15d, %r15d
	xorl	%r13d, %r13d
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
LBB0_22:
	movq	24(%rbx), %rsi
	testq	%rsi, %rsi
	je	LBB0_28
## %bb.23:
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	cmpq	$0, (%rax)
	je	LBB0_26
## %bb.24:
	cmpq	%r15, %rsi
	je	LBB0_27
## %bb.25:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_i915_gem_detach_phys_object
	jmp	LBB0_27
LBB0_4:
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_33
LBB0_7:
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	cmpq	$0, (%rax)
	je	LBB0_8
## %bb.14:
	movq	%r14, %r13
	movq	%r14, %rdi
	callq	_IS_I830
	testq	%rax, %rax
	movl	$256, %eax                      ## imm = 0x100
	movl	$16384, %ecx                    ## imm = 0x4000
	cmovel	%eax, %ecx
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	cmpq	$0, (%rbx)
	jne	LBB0_15
## %bb.16:
	movq	_I915_GEM_PHYS_CURSOR_0@GOTPCREL(%rip), %rax
	jmp	LBB0_17
LBB0_26:
	movq	%rsi, %rdi
	callq	_i915_gem_object_unpin
LBB0_27:
	movq	24(%rbx), %rdi
	addq	$4, %rdi
	callq	_drm_gem_object_unreference
LBB0_28:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	movl	%r13d, 8(%rbx)
	movq	%r15, 24(%rbx)
	movl	%r12d, 12(%rbx)
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 16(%rbx)
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_intel_crtc_update_cursor
	xorl	%r13d, %r13d
	jmp	LBB0_33
LBB0_8:
	cmpq	$0, 16(%r15)
	je	LBB0_10
## %bb.9:
	leaq	L_.str.3(%rip), %rdi
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_31
LBB0_15:
	movq	_I915_GEM_PHYS_CURSOR_1@GOTPCREL(%rip), %rax
LBB0_17:
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movl	(%rax), %edx
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_i915_gem_attach_phys_object
	testl	%eax, %eax
	je	LBB0_18
## %bb.29:
	movl	%eax, %r13d
	leaq	L_.str.6(%rip), %rdi
LBB0_30:
	callq	_DRM_ERROR
LBB0_31:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
LBB0_32:
	addq	$4, %r15
	movq	%r15, %rdi
	callq	_drm_gem_object_unreference_unlocked
LBB0_33:
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	movq	8(%r15), %rax
	movq	(%rax), %rax
LBB0_20:
	movl	(%rax), %r13d
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_IS_GEN2
	testq	%rax, %rax
	je	LBB0_22
## %bb.21:
	movq	_CURSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$262208, %esi                   ## imm = 0x40040
	callq	_I915_WRITE
	jmp	LBB0_22
LBB0_10:
	movq	%r15, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_i915_gem_object_pin_to_display_plane
	testl	%eax, %eax
	je	LBB0_12
## %bb.11:
	movl	%eax, %r13d
	leaq	L_.str.4(%rip), %rdi
	jmp	LBB0_30
LBB0_12:
	movq	%r15, %rdi
	callq	_i915_gem_object_put_fence
	testl	%eax, %eax
	je	LBB0_19
## %bb.13:
	movl	%eax, %r13d
	leaq	L_.str.5(%rip), %rdi
	callq	_DRM_ERROR
	movq	%r15, %rdi
	callq	_i915_gem_object_unpin
	jmp	LBB0_31
LBB0_19:
	movq	%r15, %rax
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cursor off\n"

L_.str.1:                               ## @.str.1
	.asciz	"we currently only support 64x64 cursors\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ENOENT,4,2                     ## @ENOENT
L_.str.2:                               ## @.str.2
	.asciz	"buffer is to small\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.3:                               ## @.str.3
	.asciz	"cursor cannot be tiled\n"

L_.str.4:                               ## @.str.4
	.asciz	"failed to move cursor bo into the GTT\n"

L_.str.5:                               ## @.str.5
	.asciz	"failed to release fence for cursor"

	.comm	_I915_GEM_PHYS_CURSOR_0,4,2     ## @I915_GEM_PHYS_CURSOR_0
	.comm	_I915_GEM_PHYS_CURSOR_1,4,2     ## @I915_GEM_PHYS_CURSOR_1
L_.str.6:                               ## @.str.6
	.asciz	"failed to attach phys object\n"

	.comm	_CURSIZE,4,2                    ## @CURSIZE
	.no_dead_strip	_intel_crtc_cursor_set
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function intel_crtc_cursor_set
_intel_crtc_cursor_set:                 ; @intel_crtc_cursor_set
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x4
	mov	x22, x3
	mov	x24, x2
	mov	x25, x1
	mov	x21, x0
	ldr	x19, [x0]
	ldr	x27, [x19, #8]
	bl	_to_intel_crtc
	mov	x23, x0
	cbz	w24, LBB0_5
; %bb.1:
	cmp	w22, #64
	b.ne	LBB0_10
; %bb.2:
	cmp	w20, #64
	b.ne	LBB0_10
; %bb.3:
	mov	x0, x19
	mov	x1, x25
	mov	x2, x24
	bl	_drm_gem_object_lookup
	bl	_to_intel_bo
	mov	x25, x0
	ldr	w8, [x25, #4]!
	cmp	w8, #4, lsl #12                 ; =16384
	b.ge	LBB0_11
; %bb.4:
Lloh0:
	adrp	x0, l_.str.2@PAGE
Lloh1:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_ERROR
Lloh2:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w26, w8
	b	LBB0_21
LBB0_5:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG_KMS
	mov	x0, x19
	bl	_mutex_lock
	mov	x24, #0
	mov	w25, #0
LBB0_6:
	ldr	x1, [x23, #24]
	cbz	x1, LBB0_17
; %bb.7:
	ldr	x8, [x27]
	ldr	x8, [x8]
	cbz	x8, LBB0_15
; %bb.8:
	cmp	x1, x24
	b.eq	LBB0_16
; %bb.9:
	mov	x0, x19
	bl	_i915_gem_detach_phys_object
	b	LBB0_16
LBB0_10:
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w26, w8
	b	LBB0_22
LBB0_11:
	mov	x24, x0
	mov	x0, x19
	bl	_mutex_lock
	ldr	x8, [x27]
	ldr	x8, [x8]
	cbz	x8, LBB0_18
; %bb.12:
	mov	x0, x19
	bl	_IS_I830
	cmp	x0, #0
	mov	w8, #16384
	mov	w9, #256
	csel	w3, w9, w8, eq
Lloh12:
	adrp	x8, _I915_GEM_PHYS_CURSOR_0@GOTPAGE
Lloh13:
	ldr	x8, [x8, _I915_GEM_PHYS_CURSOR_0@GOTPAGEOFF]
	ldr	x9, [x23]
Lloh14:
	adrp	x10, _I915_GEM_PHYS_CURSOR_1@GOTPAGE
Lloh15:
	ldr	x10, [x10, _I915_GEM_PHYS_CURSOR_1@GOTPAGEOFF]
	cmp	x9, #0
	csel	x8, x8, x10, eq
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x24
	bl	_i915_gem_attach_phys_object
	cbz	w0, LBB0_23
; %bb.13:
	mov	x26, x0
Lloh16:
	adrp	x0, l_.str.6@PAGE
Lloh17:
	add	x0, x0, l_.str.6@PAGEOFF
LBB0_14:
	bl	_DRM_ERROR
	b	LBB0_20
LBB0_15:
	mov	x0, x1
	bl	_i915_gem_object_unpin
LBB0_16:
	ldr	x8, [x23, #24]
	add	x0, x8, #4
	bl	_drm_gem_object_unreference
LBB0_17:
	mov	x0, x19
	bl	_mutex_unlock
	str	x24, [x23, #24]
	stp	w25, w22, [x23, #8]
	str	w20, [x23, #16]
	mov	x0, x21
	mov	w1, #1
	bl	_intel_crtc_update_cursor
	mov	w26, #0
	b	LBB0_22
LBB0_18:
	ldr	x8, [x24, #16]
	cbz	x8, LBB0_26
; %bb.19:
Lloh18:
	adrp	x0, l_.str.3@PAGE
Lloh19:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DRM_ERROR
Lloh20:
	adrp	x8, _EINVAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w26, w8
LBB0_20:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_21:
	mov	x0, x25
	bl	_drm_gem_object_unreference_unlocked
LBB0_22:
	mov	x0, x26
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_23:
	ldr	x8, [x24, #8]
	ldr	x8, [x8]
LBB0_24:
	ldr	w25, [x8]
	mov	x0, x19
	bl	_IS_GEN2
	cbz	x0, LBB0_6
; %bb.25:
Lloh23:
	adrp	x8, _CURSIZE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _CURSIZE@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x8]
	mov	w1, #64
	movk	w1, #4, lsl #16
	bl	_I915_WRITE
	b	LBB0_6
LBB0_26:
	mov	x0, x24
	mov	w1, #0
	mov	x2, #0
	bl	_i915_gem_object_pin_to_display_plane
	cbz	w0, LBB0_28
; %bb.27:
	mov	x26, x0
Lloh26:
	adrp	x0, l_.str.4@PAGE
Lloh27:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_14
LBB0_28:
	mov	x0, x24
	bl	_i915_gem_object_put_fence
	cbz	w0, LBB0_30
; %bb.29:
	mov	x26, x0
Lloh28:
	adrp	x0, l_.str.5@PAGE
Lloh29:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_DRM_ERROR
	mov	x0, x24
	bl	_i915_gem_object_unpin
	b	LBB0_20
LBB0_30:
	mov	x8, x24
	b	LBB0_24
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cursor off\n"

l_.str.1:                               ; @.str.1
	.asciz	"we currently only support 64x64 cursors\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ENOENT,4,2                     ; @ENOENT
l_.str.2:                               ; @.str.2
	.asciz	"buffer is to small\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.3:                               ; @.str.3
	.asciz	"cursor cannot be tiled\n"

l_.str.4:                               ; @.str.4
	.asciz	"failed to move cursor bo into the GTT\n"

l_.str.5:                               ; @.str.5
	.asciz	"failed to release fence for cursor"

	.comm	_I915_GEM_PHYS_CURSOR_0,4,2     ; @I915_GEM_PHYS_CURSOR_0
	.comm	_I915_GEM_PHYS_CURSOR_1,4,2     ; @I915_GEM_PHYS_CURSOR_1
l_.str.6:                               ; @.str.6
	.asciz	"failed to attach phys object\n"

	.comm	_CURSIZE,4,2                    ; @CURSIZE
	.no_dead_strip	_intel_crtc_cursor_set
.subsections_via_symbols
