	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function restore_rgb_planes10_c
LCPI0_0:
	.long	512                             ## 0x200
	.long	512                             ## 0x200
	.long	512                             ## 0x200
	.long	512                             ## 0x200
LCPI0_1:
	.long	1023                            ## 0x3ff
	.long	1023                            ## 0x3ff
	.long	1023                            ## 0x3ff
	.long	1023                            ## 0x3ff
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_restore_rgb_planes10_c:                ## @restore_rgb_planes10_c
	.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
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -88(%rbp)                 ## 8-byte Spill
	movq	%rsi, -80(%rbp)                 ## 8-byte Spill
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movl	24(%rbp), %r14d
	testl	%r14d, %r14d
	jle	LBB0_21
## %bb.1:
	movl	16(%rbp), %r15d
	movslq	%ecx, %rax
	movslq	%r8d, %rcx
	movslq	%r9d, %rdx
	movl	%r15d, %r10d
	movl	%r10d, %esi
	andl	$-4, %esi
	movq	%rsi, -120(%rbp)                ## 8-byte Spill
	addq	$-4, %rsi
	movq	%rsi, -112(%rbp)                ## 8-byte Spill
	movq	%rsi, %rdi
	shrq	$2, %rdi
	incq	%rdi
	movq	%rdi, %rsi
	movq	%rdi, -104(%rbp)                ## 8-byte Spill
	andq	$-2, %rdi
	movq	%rdi, -96(%rbp)                 ## 8-byte Spill
	movq	%r10, %rsi
	negq	%rsi
	movq	%rsi, -152(%rbp)                ## 8-byte Spill
	movq	%rax, -144(%rbp)                ## 8-byte Spill
	leaq	(,%rax,4), %r12
	movq	%rcx, -136(%rbp)                ## 8-byte Spill
	leaq	(,%rcx,4), %r13
	movq	%rdx, -128(%rbp)                ## 8-byte Spill
	leaq	(,%rdx,4), %r9
	movdqa	LCPI0_0(%rip), %xmm0            ## xmm0 = [512,512,512,512]
	movdqa	LCPI0_1(%rip), %xmm1            ## xmm1 = [1023,1023,1023,1023]
	xorl	%r11d, %r11d
	movl	$512, %r8d                      ## imm = 0x200
	movq	-88(%rbp), %rdx                 ## 8-byte Reload
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movq	%r9, -48(%rbp)                  ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_2 Depth=1
	addq	%r12, %rdi
	addq	%r13, %rsi
	addq	%r9, %rdx
	incq	%r11
	cmpl	%r14d, %r11d
	je	LBB0_21
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_12 Depth 2
                                        ##     Child Loop BB0_19 Depth 2
	testl	%r15d, %r15d
	jle	LBB0_20
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$4, %r15d
	jae	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%eax, %eax
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r11, %r9
	imulq	-144(%rbp), %r9                 ## 8-byte Folded Reload
	addq	%r10, %r9
	movq	%r11, %rbx
	imulq	-128(%rbp), %rbx                ## 8-byte Folded Reload
	addq	%r10, %rbx
	movq	%r11, %rcx
	imulq	-136(%rbp), %rcx                ## 8-byte Folded Reload
	addq	%r10, %rcx
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r9,4), %r12
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%rbx,4), %rbx
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%rcx,4), %rcx
	cmpq	%rbx, %rdi
	setb	%r15b
	cmpq	%r12, %rdx
	setb	%r9b
	cmpq	%rcx, %rdi
	setb	%r14b
	cmpq	%r12, %rsi
	setb	%r13b
	cmpq	%rcx, %rdx
	setb	%r12b
	cmpq	%rbx, %rsi
	setb	%cl
	testb	%r9b, %r15b
	jne	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	andb	%r13b, %r14b
	jne	LBB0_6
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	$0, %eax
	andb	%cl, %r12b
	movl	24(%rbp), %r14d
	movl	16(%rbp), %r15d
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movq	-48(%rbp), %r9                  ## 8-byte Reload
	jne	LBB0_16
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpq	$0, -112(%rbp)                  ## 8-byte Folded Reload
	je	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	-96(%rbp), %rbx                 ## 8-byte Reload
	xorl	%r9d, %r9d
	.p2align	4, 0x90
LBB0_12:                                ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movdqu	(%rdi,%r9,4), %xmm2
	movdqu	(%rsi,%r9,4), %xmm3
	movdqu	(%rdx,%r9,4), %xmm4
	paddd	%xmm0, %xmm3
	paddd	%xmm3, %xmm2
	pand	%xmm1, %xmm2
	movdqu	%xmm2, (%rdi,%r9,4)
	paddd	%xmm4, %xmm3
	pand	%xmm1, %xmm3
	movdqu	%xmm3, (%rdx,%r9,4)
	movdqu	16(%rdi,%r9,4), %xmm2
	movdqu	16(%rsi,%r9,4), %xmm3
	movdqu	16(%rdx,%r9,4), %xmm4
	paddd	%xmm0, %xmm3
	paddd	%xmm3, %xmm2
	pand	%xmm1, %xmm2
	movdqu	%xmm2, 16(%rdi,%r9,4)
	paddd	%xmm4, %xmm3
	pand	%xmm1, %xmm3
	movdqu	%xmm3, 16(%rdx,%r9,4)
	addq	$8, %r9
	addq	$-2, %rbx
	jne	LBB0_12
## %bb.13:                              ##   in Loop: Header=BB0_2 Depth=1
	testb	$1, -104(%rbp)                  ## 1-byte Folded Reload
	je	LBB0_15
LBB0_14:                                ##   in Loop: Header=BB0_2 Depth=1
	movdqu	(%rdi,%r9,4), %xmm2
	movdqu	(%rsi,%r9,4), %xmm3
	movdqu	(%rdx,%r9,4), %xmm4
	paddd	%xmm0, %xmm3
	paddd	%xmm3, %xmm2
	pand	%xmm1, %xmm2
	movdqu	%xmm2, (%rdi,%r9,4)
	paddd	%xmm4, %xmm3
	pand	%xmm1, %xmm3
	movdqu	%xmm3, (%rdx,%r9,4)
LBB0_15:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	-120(%rbp), %rcx                ## 8-byte Reload
	movq	%rcx, %rax
	cmpq	%r10, %rcx
	movq	-48(%rbp), %r9                  ## 8-byte Reload
	je	LBB0_20
	jmp	LBB0_16
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	xorl	%eax, %eax
	movl	24(%rbp), %r14d
	movl	16(%rbp), %r15d
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movq	-48(%rbp), %r9                  ## 8-byte Reload
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, %rbx
	testb	$1, %r10b
	je	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	(%rsi,%rax,4), %ecx
	addl	%r8d, %ecx
	movl	(%rdi,%rax,4), %ebx
	addl	%ecx, %ebx
	andl	$1023, %ebx                     ## imm = 0x3FF
	addl	(%rdx,%rax,4), %ecx
	movl	%ebx, (%rdi,%rax,4)
	andl	$1023, %ecx                     ## imm = 0x3FF
	movl	%ecx, (%rdx,%rax,4)
	movq	%rax, %rbx
	orq	$1, %rbx
LBB0_18:                                ##   in Loop: Header=BB0_2 Depth=1
	notq	%rax
	cmpq	-152(%rbp), %rax                ## 8-byte Folded Reload
	je	LBB0_20
	.p2align	4, 0x90
LBB0_19:                                ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%rsi,%rbx,4), %eax
	addl	%r8d, %eax
	movl	(%rdi,%rbx,4), %ecx
	addl	%eax, %ecx
	addl	(%rdx,%rbx,4), %eax
	andl	$1023, %ecx                     ## imm = 0x3FF
	movl	%ecx, (%rdi,%rbx,4)
	andl	$1023, %eax                     ## imm = 0x3FF
	movl	%eax, (%rdx,%rbx,4)
	movl	4(%rsi,%rbx,4), %eax
	addl	%r8d, %eax
	movl	4(%rdi,%rbx,4), %ecx
	addl	%eax, %ecx
	andl	$1023, %ecx                     ## imm = 0x3FF
	addl	4(%rdx,%rbx,4), %eax
	movl	%ecx, 4(%rdi,%rbx,4)
	andl	$1023, %eax                     ## imm = 0x3FF
	movl	%eax, 4(%rdx,%rbx,4)
	addq	$2, %rbx
	cmpq	%rbx, %r10
	jne	LBB0_19
	jmp	LBB0_20
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	xorl	%r9d, %r9d
	testb	$1, -104(%rbp)                  ## 1-byte Folded Reload
	jne	LBB0_14
	jmp	LBB0_15
LBB0_21:
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_restore_rgb_planes10_c
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function restore_rgb_planes10_c
_restore_rgb_planes10_c:                ; @restore_rgb_planes10_c
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	.cfi_offset w19, -8
	.cfi_offset w20, -16
	.cfi_offset w21, -24
	.cfi_offset w22, -32
	.cfi_offset w23, -40
	.cfi_offset w24, -48
                                        ; kill: def $w5 killed $w5 def $x5
                                        ; kill: def $w4 killed $w4 def $x4
                                        ; kill: def $w3 killed $w3 def $x3
	cmp	w7, #1
	b.lt	LBB0_13
; %bb.1:
	mov	x8, #0
	sxtw	x9, w3
	sxtw	x10, w4
	mov	w11, w6
	sxtw	x12, w5
	and	x13, x11, #0xfffffff8
	lsl	x14, x11, #2
	and	x14, x14, #0x3ffffffe0
	sbfiz	x15, x3, #2, #32
	sbfiz	x16, x5, #2, #32
	movi.4s	v0, #2, lsl #8
	movi.4s	v1, #3, msl #8
	mov	x17, x1
	mov	x3, x2
	mov	x5, x0
	sbfiz	x4, x4, #2, #32
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x5, x5, x15
	add	x17, x17, x4
	add	x3, x3, x16
	add	x8, x8, #1
	cmp	w8, w7
	b.eq	LBB0_13
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_10 Depth 2
                                        ;     Child Loop BB0_12 Depth 2
	cmp	w6, #1
	b.lt	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	cmp	w6, #8
	b.hs	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x19, #0
	b	LBB0_12
LBB0_6:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x19, #0
	madd	x20, x8, x9, x11
	add	x22, x0, x20, lsl #2
	madd	x20, x8, x12, x11
	add	x23, x2, x20, lsl #2
	madd	x20, x8, x10, x11
	add	x21, x1, x20, lsl #2
	cmp	x5, x21
	ccmp	x17, x22, #2, lo
	cset	w20, lo
	cmp	x3, x21
	ccmp	x17, x23, #2, lo
	cset	w21, lo
	cmp	x3, x22
	ccmp	x5, x23, #2, lo
	b.lo	LBB0_12
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	tbnz	w20, #0, LBB0_12
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
	tbnz	w21, #0, LBB0_12
; %bb.9:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x19, #0
LBB0_10:                                ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	x20, x5, x19
	ldp	q2, q3, [x20]
	add	x21, x17, x19
	ldp	q4, q5, [x21]
	add	x21, x3, x19
	ldp	q6, q7, [x21]
	add.4s	v4, v4, v0
	add.4s	v5, v5, v0
	add.4s	v2, v4, v2
	add.4s	v3, v5, v3
	and.16b	v2, v2, v1
	and.16b	v3, v3, v1
	stp	q2, q3, [x20]
	add.4s	v2, v4, v6
	add.4s	v3, v5, v7
	and.16b	v2, v2, v1
	and.16b	v3, v3, v1
	stp	q2, q3, [x21]
	add	x19, x19, #32
	cmp	x14, x19
	b.ne	LBB0_10
; %bb.11:                               ;   in Loop: Header=BB0_3 Depth=1
	mov	x19, x13
	cmp	x13, x11
	b.eq	LBB0_2
LBB0_12:                                ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	lsl	x20, x19, #2
	ldr	w21, [x5, x20]
	ldr	w22, [x17, x20]
	ldr	w23, [x3, x20]
	add	w22, w22, #512
	add	w21, w22, w21
	and	w21, w21, #0x3ff
	str	w21, [x5, x20]
	add	w21, w22, w23
	and	w21, w21, #0x3ff
	str	w21, [x3, x20]
	add	x19, x19, #1
	cmp	x11, x19
	b.ne	LBB0_12
	b	LBB0_2
LBB0_13:
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #48             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_restore_rgb_planes10_c
.subsections_via_symbols
