	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dce_v11_0_crtc_cursor_set2
_dce_v11_0_crtc_cursor_set2:            ## @dce_v11_0_crtc_cursor_set2
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, -64(%rbp)                  ## 8-byte Spill
	movq	%r8, %rbx
	movq	%rcx, %r15
	movq	%rdx, %r12
	movq	%rsi, %r14
	movq	%rdi, %r13
	callq	_to_amdgpu_crtc
	testq	%r12, %r12
	je	LBB0_1
## %bb.2:
	cmpq	%r15, (%rax)
	jl	LBB0_4
## %bb.3:
	cmpq	%rbx, 8(%rax)
	jge	LBB0_5
LBB0_4:
	leaq	L_.str(%rip), %rdi
	xorl	%r14d, %r14d
	movl	%r15d, %esi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	jmp	LBB0_22
LBB0_1:
	movq	%r13, %rdi
	movq	%rax, %r15
	callq	_dce_v11_0_hide_cursor
	xorl	%r14d, %r14d
LBB0_17:
	movq	64(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_21
## %bb.18:
	callq	_gem_to_amdgpu_bo
	movq	%rax, %rbx
	movq	%rax, %rdi
	movl	$1, %esi
	callq	_amdgpu_bo_reserve
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_likely
	testq	%rax, %rax
	je	LBB0_20
## %bb.19:
	movq	%rbx, %rdi
	callq	_amdgpu_bo_unpin
	movq	%rbx, %rdi
	callq	_amdgpu_bo_unreserve
LBB0_20:
	movq	64(%r15), %rdi
	callq	_drm_gem_object_put_unlocked
LBB0_21:
	movq	%r14, 64(%r15)
	xorl	%r14d, %r14d
LBB0_22:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_drm_gem_object_lookup
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_gem_to_amdgpu_bo
	movq	%rax, %r12
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_amdgpu_bo_reserve
	movq	%r14, %rdi
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	movl	%eax, %r14d
	callq	_drm_gem_object_put_unlocked
	jmp	LBB0_22
LBB0_6:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	76(%rax), %edx
	leaq	L_.str.1(%rip), %rdi
	xorl	%r14d, %r14d
	movl	%r12d, %esi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_ENOENT@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	jmp	LBB0_22
LBB0_9:
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	_AMDGPU_GEM_DOMAIN_VRAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_amdgpu_bo_pin
	movl	%eax, %r14d
	movq	%r12, %rdi
	callq	_amdgpu_bo_unreserve
	testl	%r14d, %r14d
	je	LBB0_11
## %bb.10:
	leaq	L_.str.2(%rip), %rdi
	movl	%r14d, %esi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_drm_gem_object_put_unlocked
	jmp	LBB0_22
LBB0_11:
	movq	16(%rbp), %r14
	movq	%r12, %rdi
	callq	_amdgpu_bo_gpu_offset
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movl	%eax, 72(%r12)
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_dce_v11_0_lock_cursor
	movq	%r12, %rax
	cmpq	%r15, 16(%r12)
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	jne	LBB0_15
## %bb.12:
	cmpq	%rbx, 24(%rax)
	jne	LBB0_15
## %bb.13:
	cmpq	%r12, 32(%rax)
	jne	LBB0_15
## %bb.14:
	cmpq	%r14, 40(%rax)
	je	LBB0_16
LBB0_15:
	movl	48(%rax), %esi
	subl	%r12d, %esi
	addl	32(%rax), %esi
	movl	56(%rax), %edx
	subl	%r14d, %edx
	addl	40(%rax), %edx
	movq	%r13, %rdi
	callq	_dce_v11_0_cursor_move_locked
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%r15, 16(%rax)
	movq	%rbx, 24(%rax)
	movq	%r12, 32(%rax)
	movq	%r14, 40(%rax)
LBB0_16:
	movq	%r13, %rdi
	callq	_dce_v11_0_show_cursor
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_dce_v11_0_lock_cursor
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bad cursor width or height %d x %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"Cannot find cursor object %x for crtc %d\n"

	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_AMDGPU_GEM_DOMAIN_VRAM,4,2     ## @AMDGPU_GEM_DOMAIN_VRAM
L_.str.2:                               ## @.str.2
	.asciz	"Failed to pin new cursor BO (%d)\n"

	.no_dead_strip	_dce_v11_0_crtc_cursor_set2
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dce_v11_0_crtc_cursor_set2
_dce_v11_0_crtc_cursor_set2:            ; @dce_v11_0_crtc_cursor_set2
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x24, x6
	mov	x25, x5
	mov	x23, x4
	mov	x22, x3
	mov	x26, x2
	mov	x20, x1
	mov	x21, x0
	bl	_to_amdgpu_crtc
	mov	x19, x0
	cbz	x26, LBB0_5
; %bb.1:
	ldr	x8, [x19]
	cmp	x8, x22
	b.lt	LBB0_3
; %bb.2:
	ldr	x8, [x19, #8]
	cmp	x8, x23
	b.ge	LBB0_11
LBB0_3:
	str	x23, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x22
	bl	_DRM_ERROR
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w26, w8
	b	LBB0_10
LBB0_5:
	mov	x0, x21
	bl	_dce_v11_0_hide_cursor
	mov	x20, #0
	ldr	x0, [x19, #64]
	cbz	x0, LBB0_9
LBB0_6:
	bl	_gem_to_amdgpu_bo
	mov	x21, x0
	mov	w1, #1
	bl	_amdgpu_bo_reserve
	cmp	w0, #0
	cset	w0, eq
	bl	_likely
	cbz	x0, LBB0_8
; %bb.7:
	mov	x0, x21
	bl	_amdgpu_bo_unpin
	mov	x0, x21
	bl	_amdgpu_bo_unreserve
LBB0_8:
	ldr	x0, [x19, #64]
	bl	_drm_gem_object_put_unlocked
LBB0_9:
	mov	w26, #0
	str	x20, [x19, #64]
LBB0_10:
	mov	x0, x26
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_11:
	mov	x0, x20
	mov	x1, x26
	bl	_drm_gem_object_lookup
	cbz	x0, LBB0_14
; %bb.12:
	mov	x20, x0
	bl	_gem_to_amdgpu_bo
	mov	x27, x0
	mov	w1, #0
	bl	_amdgpu_bo_reserve
	cbz	w0, LBB0_15
; %bb.13:
	mov	x26, x0
	b	LBB0_17
LBB0_14:
	ldr	w8, [x19, #76]
	str	x8, [sp]
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x26
	bl	_DRM_ERROR
Lloh6:
	adrp	x8, _ENOENT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
	b	LBB0_4
LBB0_15:
Lloh8:
	adrp	x8, _AMDGPU_GEM_DOMAIN_VRAM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AMDGPU_GEM_DOMAIN_VRAM@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x27
	bl	_amdgpu_bo_pin
	mov	x26, x0
	mov	x0, x27
	bl	_amdgpu_bo_unreserve
	cbz	w26, LBB0_18
; %bb.16:
Lloh11:
	adrp	x0, l_.str.2@PAGE
Lloh12:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x26
	bl	_DRM_ERROR
LBB0_17:
	mov	x0, x20
	bl	_drm_gem_object_put_unlocked
	b	LBB0_10
LBB0_18:
	mov	x0, x27
	bl	_amdgpu_bo_gpu_offset
	str	w0, [x19, #72]
	mov	x0, x21
	mov	w1, #1
	bl	_dce_v11_0_lock_cursor
	ldr	x8, [x19, #16]
	cmp	x8, x22
	b.ne	LBB0_22
; %bb.19:
	ldr	x8, [x19, #24]
	cmp	x8, x23
	b.ne	LBB0_22
; %bb.20:
	ldr	x8, [x19, #32]
	cmp	x8, x25
	b.ne	LBB0_22
; %bb.21:
	ldr	x8, [x19, #40]
	cmp	x8, x24
	b.eq	LBB0_23
LBB0_22:
	ldr	w8, [x19, #48]
	ldr	w9, [x19, #32]
	sub	w8, w8, w25
	add	w1, w8, w9
	ldr	w8, [x19, #56]
	ldr	w9, [x19, #40]
	sub	w8, w8, w24
	add	w2, w8, w9
	mov	x0, x21
	bl	_dce_v11_0_cursor_move_locked
	stp	x22, x23, [x19, #16]
	stp	x25, x24, [x19, #32]
LBB0_23:
	mov	x0, x21
	bl	_dce_v11_0_show_cursor
	mov	x0, x21
	mov	w1, #0
	bl	_dce_v11_0_lock_cursor
	ldr	x0, [x19, #64]
	cbnz	x0, LBB0_6
	b	LBB0_9
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bad cursor width or height %d x %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"Cannot find cursor object %x for crtc %d\n"

	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_AMDGPU_GEM_DOMAIN_VRAM,4,2     ; @AMDGPU_GEM_DOMAIN_VRAM
l_.str.2:                               ; @.str.2
	.asciz	"Failed to pin new cursor BO (%d)\n"

	.no_dead_strip	_dce_v11_0_crtc_cursor_set2
.subsections_via_symbols
