	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_sprite_set_colorkey_ioctl ## -- Begin function intel_sprite_set_colorkey_ioctl
	.p2align	4, 0x90
_intel_sprite_set_colorkey_ioctl:       ## @intel_sprite_set_colorkey_ioctl
	.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	%rdx, %r15
	movq	%rsi, %r14
	movq	%rdi, %rbx
	callq	_to_i915
	movq	%rax, %r13
	movq	_I915_SET_COLORKEY_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	(%r14), %eax
	movl	%eax, (%r14)
	movq	_I915_SET_COLORKEY_DESTINATION@GOTPCREL(%rip), %r12
	movq	_I915_SET_COLORKEY_SOURCE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%r12), %ecx
	movl	%ecx, %edx
	notl	%edx
	testl	%edx, %eax
	jne	LBB0_1
## %bb.3:
	notl	%eax
	testl	%eax, %ecx
	je	LBB0_1
## %bb.4:
	movq	%r13, %rdi
	callq	_IS_VALLEYVIEW
	testq	%rax, %rax
	jne	LBB0_6
## %bb.5:
	movq	%r13, %rdi
	callq	_IS_CHERRYVIEW
	testq	%rax, %rax
	je	LBB0_7
LBB0_6:
	movl	(%r12), %eax
	testl	%eax, (%r14)
	je	LBB0_7
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
LBB0_25:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movl	4(%r14), %edx
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_drm_plane_find
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	%rax, %r15
	movq	(%rax), %rax
	movq	_DRM_PLANE_TYPE_OVERLAY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.10:
	movq	%r13, %rdi
	callq	_INTEL_GEN
	cmpl	$9, %eax
	jl	LBB0_13
## %bb.11:
	movq	%r15, %rdi
	callq	_to_intel_plane
	movq	(%rax), %rax
	movq	_PLANE_SPRITE1@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jl	LBB0_13
## %bb.12:
	movl	(%r12), %eax
	testl	%eax, (%r14)
	jne	LBB0_1
LBB0_13:
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	leaq	-48(%rbp), %rbx
	xorl	%r12d, %r12d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_drm_modeset_acquire_init
	movl	8(%r15), %edi
	callq	_drm_atomic_state_alloc
	testq	%rax, %rax
	je	LBB0_14
## %bb.15:
	movq	%rax, %r13
	movq	%rbx, (%rax)
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_drm_atomic_get_plane_state
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_PTR_ERR_OR_ZERO
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_21
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	%rbx, %rdi
	callq	_to_intel_plane_state
	movl	%eax, %edi
	movq	%r14, %rsi
	callq	_intel_plane_set_ckey
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_has_dst_key_in_primary_plane
	testq	%rax, %rax
	je	LBB0_20
## %bb.18:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	%r15, %rdi
	callq	_to_intel_plane
	movl	8(%rax), %esi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_intel_get_crtc_for_pipe
	movq	(%rax), %rsi
	movq	%r13, %rdi
	callq	_drm_atomic_get_plane_state
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_PTR_ERR_OR_ZERO
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_21
## %bb.19:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	%rbx, %rdi
	callq	_to_intel_plane_state
	movl	%eax, %edi
	movq	%r14, %rsi
	callq	_intel_plane_set_ckey
LBB0_20:                                ##   in Loop: Header=BB0_16 Depth=1
	movq	%r13, %rdi
	callq	_drm_atomic_commit
	movl	%eax, %r12d
LBB0_21:                                ##   in Loop: Header=BB0_16 Depth=1
	movq	_EDEADLK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r12d, %eax
	jne	LBB0_23
## %bb.22:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	%r13, %rdi
	callq	_drm_atomic_state_clear
	leaq	-48(%rbp), %rdi
	callq	_drm_modeset_backoff
	jmp	LBB0_16
LBB0_9:
	movq	_ENOENT@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_23:
	movq	%r13, %rdi
	callq	_drm_atomic_state_put
	jmp	LBB0_24
LBB0_14:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
LBB0_24:
	leaq	-48(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_drm_modeset_drop_locks
	movq	%rbx, %rdi
	callq	_drm_modeset_acquire_fini
	jmp	LBB0_25
	.cfi_endproc
                                        ## -- End function
	.comm	_I915_SET_COLORKEY_NONE,4,2     ## @I915_SET_COLORKEY_NONE
	.comm	_I915_SET_COLORKEY_DESTINATION,4,2 ## @I915_SET_COLORKEY_DESTINATION
	.comm	_I915_SET_COLORKEY_SOURCE,4,2   ## @I915_SET_COLORKEY_SOURCE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_DRM_PLANE_TYPE_OVERLAY,8,3     ## @DRM_PLANE_TYPE_OVERLAY
	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_PLANE_SPRITE1,8,3              ## @PLANE_SPRITE1
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_EDEADLK,4,2                    ## @EDEADLK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_sprite_set_colorkey_ioctl ; -- Begin function intel_sprite_set_colorkey_ioctl
	.p2align	2
_intel_sprite_set_colorkey_ioctl:       ; @intel_sprite_set_colorkey_ioctl
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x21, x2
	mov	x19, x1
	mov	x22, x0
	bl	_to_i915
Lloh0:
	adrp	x8, _I915_SET_COLORKEY_NONE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _I915_SET_COLORKEY_NONE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [x19]
	bic	w8, w9, w8
	str	w8, [x19]
Lloh3:
	adrp	x23, _I915_SET_COLORKEY_DESTINATION@GOTPAGE
Lloh4:
	ldr	x23, [x23, _I915_SET_COLORKEY_DESTINATION@GOTPAGEOFF]
	ldr	w9, [x23]
Lloh5:
	adrp	x10, _I915_SET_COLORKEY_SOURCE@GOTPAGE
Lloh6:
	ldr	x10, [x10, _I915_SET_COLORKEY_SOURCE@GOTPAGEOFF]
Lloh7:
	ldr	w10, [x10]
	orr	w9, w10, w9
	bics	wzr, w8, w9
	b.ne	LBB0_5
; %bb.1:
	bics	wzr, w9, w8
	b.eq	LBB0_5
; %bb.2:
	mov	x20, x0
	bl	_IS_VALLEYVIEW
	cbnz	x0, LBB0_4
; %bb.3:
	mov	x0, x20
	bl	_IS_CHERRYVIEW
	cbz	x0, LBB0_8
LBB0_4:
	ldr	w8, [x19]
	ldr	w9, [x23]
	tst	w9, w8
	b.eq	LBB0_8
LBB0_5:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_7:
	mov	x0, x23
	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
	add	sp, sp, #96
	ret
LBB0_8:
	ldr	w2, [x19, #4]
	mov	x0, x22
	mov	x1, x21
	bl	_drm_plane_find
	cbz	x0, LBB0_22
; %bb.9:
	mov	x21, x0
	ldr	x8, [x0]
Lloh10:
	adrp	x9, _DRM_PLANE_TYPE_OVERLAY@GOTPAGE
Lloh11:
	ldr	x9, [x9, _DRM_PLANE_TYPE_OVERLAY@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_22
; %bb.10:
	mov	x0, x20
	bl	_INTEL_GEN
	cmp	w0, #9
	b.lt	LBB0_13
; %bb.11:
	mov	x0, x21
	bl	_to_intel_plane
	ldr	x8, [x0]
Lloh13:
	adrp	x9, _PLANE_SPRITE1@GOTPAGE
Lloh14:
	ldr	x9, [x9, _PLANE_SPRITE1@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	cmp	x8, x9
	b.lt	LBB0_13
; %bb.12:
	ldr	w8, [x19]
	ldr	w9, [x23]
	tst	w9, w8
	b.ne	LBB0_5
LBB0_13:
	add	x23, sp, #8
	add	x0, sp, #8
	mov	w1, #0
	bl	_drm_modeset_acquire_init
	ldr	w0, [x21, #8]
	bl	_drm_atomic_state_alloc
	cbz	x0, LBB0_24
; %bb.14:
	mov	x22, x0
	str	x23, [x0]
Lloh16:
	adrp	x25, _EDEADLK@GOTPAGE
Lloh17:
	ldr	x25, [x25, _EDEADLK@GOTPAGEOFF]
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	mov	x1, x21
	bl	_drm_atomic_get_plane_state
	mov	x24, x0
	bl	_PTR_ERR_OR_ZERO
	mov	x23, x0
	cbnz	w0, LBB0_20
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	x0, x24
	bl	_to_intel_plane_state
	mov	x1, x19
	bl	_intel_plane_set_ckey
	mov	x0, x20
	bl	_has_dst_key_in_primary_plane
	cbz	x0, LBB0_19
; %bb.17:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	x0, x21
	bl	_to_intel_plane
	ldr	w1, [x0, #8]
	mov	x0, x20
	bl	_intel_get_crtc_for_pipe
	ldr	x1, [x0]
	mov	x0, x22
	bl	_drm_atomic_get_plane_state
	mov	x24, x0
	bl	_PTR_ERR_OR_ZERO
	mov	x23, x0
	cbnz	w0, LBB0_20
; %bb.18:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	x0, x24
	bl	_to_intel_plane_state
	mov	x1, x19
	bl	_intel_plane_set_ckey
LBB0_19:                                ;   in Loop: Header=BB0_15 Depth=1
	mov	x0, x22
	bl	_drm_atomic_commit
	mov	x23, x0
LBB0_20:                                ;   in Loop: Header=BB0_15 Depth=1
	ldr	w8, [x25]
	cmn	w23, w8
	b.ne	LBB0_23
; %bb.21:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	x0, x22
	bl	_drm_atomic_state_clear
	add	x0, sp, #8
	bl	_drm_modeset_backoff
	b	LBB0_15
LBB0_22:
Lloh18:
	adrp	x8, _ENOENT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
	b	LBB0_6
LBB0_23:
	mov	x0, x22
	bl	_drm_atomic_state_put
	b	LBB0_25
LBB0_24:
Lloh20:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_25:
	add	x0, sp, #8
	bl	_drm_modeset_drop_locks
	add	x0, sp, #8
	bl	_drm_modeset_acquire_fini
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_I915_SET_COLORKEY_NONE,4,2     ; @I915_SET_COLORKEY_NONE
	.comm	_I915_SET_COLORKEY_DESTINATION,4,2 ; @I915_SET_COLORKEY_DESTINATION
	.comm	_I915_SET_COLORKEY_SOURCE,4,2   ; @I915_SET_COLORKEY_SOURCE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_DRM_PLANE_TYPE_OVERLAY,8,3     ; @DRM_PLANE_TYPE_OVERLAY
	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_PLANE_SPRITE1,8,3              ; @PLANE_SPRITE1
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_EDEADLK,4,2                    ; @EDEADLK
.subsections_via_symbols
