	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dc_remove_plane_from_context   ## -- Begin function dc_remove_plane_from_context
	.p2align	4, 0x90
_dc_remove_plane_from_context:          ## @dc_remove_plane_from_context
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	(%rcx), %eax
	testl	%eax, %eax
	jle	LBB0_5
## %bb.1:
	movq	%rcx, %r15
	movq	%rdx, %r14
	movq	(%rdi), %rcx
	movq	24(%r15), %rdx
	shlq	$3, %rax
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%rsi, (%rdx,%r13)
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	addq	$8, %r13
	cmpq	%r13, %rax
	jne	LBB0_2
	jmp	LBB0_5
LBB0_4:
	movq	16(%r15), %r12
	testq	%r12, %r12
	je	LBB0_5
## %bb.7:
	movl	(%rcx), %ebx
	testl	%ebx, %ebx
	jle	LBB0_14
## %bb.8:
	incq	%rbx
	jmp	LBB0_9
LBB0_5:
	leaq	L_.str(%rip), %rdi
LBB0_6:
	callq	_dm_error
	xorl	%eax, %eax
LBB0_30:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	$0, (%rdi)
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_9 Depth=1
	decq	%rbx
	cmpq	$1, %rbx
	jbe	LBB0_14
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	leal	-2(%rbx), %ecx
	movq	8(%r15), %rax
	leaq	(%rcx,%rcx,2), %rdx
	cmpq	%r14, (%rax,%rdx,8)
	jne	LBB0_17
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	leaq	(%rax,%rdx,8), %rdi
	movq	8(%rax,%rdx,8), %rcx
	testq	%rcx, %rcx
	je	LBB0_16
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	16(%rax,%rdx,8), %rax
	movq	%rax, (%rcx)
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%rcx, (%rax)
LBB0_13:                                ##   in Loop: Header=BB0_9 Depth=1
	xorl	%esi, %esi
	movl	$24, %edx
	callq	_memset
	jmp	LBB0_17
LBB0_14:
	movl	(%r12,%r13,2), %eax
	testl	%eax, %eax
	jle	LBB0_15
## %bb.18:
	movq	8(%r12,%r13,2), %rcx
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	cmpq	%r14, (%rcx,%rbx,8)
	je	LBB0_20
## %bb.31:                              ##   in Loop: Header=BB0_19 Depth=1
	incq	%rbx
	cmpq	%rbx, %rax
	jne	LBB0_19
	jmp	LBB0_22
LBB0_15:
	xorl	%ebx, %ebx
	cmpl	%eax, %ebx
	jne	LBB0_23
LBB0_22:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_6
LBB0_20:
	movq	%r14, %rdi
	callq	_dc_plane_state_release
	movl	(%r12,%r13,2), %eax
	cmpl	%eax, %ebx
	je	LBB0_22
LBB0_23:
	leal	-1(%rax), %r8d
	movl	%r8d, (%r12,%r13,2)
	cmpl	%r8d, %ebx
	jge	LBB0_29
## %bb.24:
	movl	%ebx, %edi
	movl	%ebx, %esi
	notl	%esi
	addl	%eax, %esi
	subl	%ebx, %eax
	addl	$-2, %eax
	andl	$3, %esi
	je	LBB0_25
	.p2align	4, 0x90
LBB0_26:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r12,%r13,2), %rbx
	leaq	1(%rdi), %rdx
	movq	8(%rbx,%rdi,8), %rcx
	movq	%rcx, (%rbx,%rdi,8)
	movq	%rdx, %rdi
	decl	%esi
	jne	LBB0_26
	jmp	LBB0_27
LBB0_25:
	movq	%rdi, %rdx
LBB0_27:
	cmpl	$3, %eax
	jb	LBB0_29
	.p2align	4, 0x90
LBB0_28:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r12,%r13,2), %rax
	movq	8(%rax,%rdx,8), %rcx
	movq	%rcx, (%rax,%rdx,8)
	movq	8(%r12,%r13,2), %rax
	movq	16(%rax,%rdx,8), %rcx
	movq	%rcx, 8(%rax,%rdx,8)
	movq	8(%r12,%r13,2), %rax
	movq	24(%rax,%rdx,8), %rcx
	movq	%rcx, 16(%rax,%rdx,8)
	movq	8(%r12,%r13,2), %rax
	movq	32(%rax,%rdx,8), %rcx
	movq	%rcx, 24(%rax,%rdx,8)
	leaq	4(%rdx), %rax
	movq	%rax, %rdx
	cmpl	%eax, %r8d
	jg	LBB0_28
LBB0_29:
	movq	8(%r12,%r13,2), %rax
	movslq	%r8d, %rcx
	movq	$0, (%rax,%rcx,8)
	movl	$1, %eax
	jmp	LBB0_30
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Existing stream not found; failed to remove plane.\n"

L_.str.1:                               ## @.str.1
	.asciz	"Existing plane_state not found; failed to detach it!\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dc_remove_plane_from_context   ; -- Begin function dc_remove_plane_from_context
	.p2align	2
_dc_remove_plane_from_context:          ; @dc_remove_plane_from_context
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldr	w10, [x3]
	cmp	w10, #1
	b.lt	LBB0_7
; %bb.1:
	mov	x20, x3
	mov	x19, x2
	mov	x21, #0
	ldr	x8, [x0]
	ldr	x9, [x3, #24]
	lsl	x10, x10, #4
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x9]
	cmp	x11, x1
	b.eq	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x21, x21, #16
	add	x9, x9, #8
	cmp	x10, x21
	b.ne	LBB0_2
	b	LBB0_7
LBB0_4:
	ldr	x22, [x20, #16]
	cbz	x22, LBB0_7
; %bb.5:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_17
; %bb.6:
	add	x23, x8, #1
	mov	w24, #24
	b	LBB0_12
LBB0_7:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
LBB0_8:
	bl	_dm_error
	mov	w0, #0
LBB0_9:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_10:                                ;   in Loop: Header=BB0_12 Depth=1
	str	xzr, [x0]
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	sub	x23, x23, #1
	cmp	x23, #1
	b.ls	LBB0_17
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	sub	w8, w23, #2
	ldr	x9, [x20, #8]
	umaddl	x0, w8, w24, x9
	ldr	x10, [x0]
	cmp	x10, x19
	b.ne	LBB0_11
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	madd	x10, x8, x24, x9
	ldr	x10, [x10, #8]
	cbz	x10, LBB0_10
; %bb.14:                               ;   in Loop: Header=BB0_12 Depth=1
	madd	x8, x8, x24, x9
	ldr	x8, [x8, #16]
	str	x8, [x10]
	cbz	x8, LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_12 Depth=1
	str	x10, [x8]
LBB0_16:                                ;   in Loop: Header=BB0_12 Depth=1
	mov	w1, #0
	mov	w2, #24
	bl	_memset
	b	LBB0_11
LBB0_17:
	ldr	w8, [x22, x21]
	cmp	w8, #1
	b.lt	LBB0_21
; %bb.18:
	mov	x20, #0
	add	x9, x22, x21
	ldr	x9, [x9, #8]
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x9, x20, lsl #3]
	cmp	x10, x19
	b.eq	LBB0_23
; %bb.20:                               ;   in Loop: Header=BB0_19 Depth=1
	add	x20, x20, #1
	cmp	x8, x20
	b.ne	LBB0_19
	b	LBB0_22
LBB0_21:
	mov	w20, #0
	cmp	w20, w8
	b.ne	LBB0_24
LBB0_22:
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_8
LBB0_23:
	mov	x0, x19
	bl	_dc_plane_state_release
	ldr	w8, [x22, x21]
	cmp	w20, w8
	b.eq	LBB0_22
LBB0_24:
	sub	w8, w8, #1
	str	w8, [x22, x21]
	cmp	w20, w8
	b.ge	LBB0_27
; %bb.25:
	add	x9, x22, x21
	mov	w10, w20
	lsl	x10, x10, #3
LBB0_26:                                ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x9, #8]
	add	x11, x11, x10
	ldr	x12, [x11, #8]
	str	x12, [x11]
	add	x10, x10, #8
	add	w20, w20, #1
	cmp	w8, w20
	b.gt	LBB0_26
LBB0_27:
	add	x9, x22, x21
	ldr	x9, [x9, #8]
	str	xzr, [x9, w8, sxtw #3]
	mov	w0, #1
	b	LBB0_9
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Existing stream not found; failed to remove plane.\n"

l_.str.1:                               ; @.str.1
	.asciz	"Existing plane_state not found; failed to detach it!\n"

.subsections_via_symbols
