	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function planar_rgb_to_y
LCPI0_0:
	.long	4294967289                      ## 0xfffffff9
	.long	4294967289                      ## 0xfffffff9
	.long	4294967289                      ## 0xfffffff9
	.long	4294967289                      ## 0xfffffff9
LCPI0_1:
	.long	2049                            ## 0x801
	.long	2049                            ## 0x801
	.long	2049                            ## 0x801
	.long	2049                            ## 0x801
LCPI0_2:
	.long	4294967290                      ## 0xfffffffa
	.long	4294967290                      ## 0xfffffffa
	.long	4294967290                      ## 0xfffffffa
	.long	4294967290                      ## 0xfffffffa
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_planar_rgb_to_y:                       ## @planar_rgb_to_y
	.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
	testl	%edx, %edx
	jle	LBB0_12
## %bb.1:
	movq	_RY_IDX@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rcx,%rax,4), %r8d
	movq	_GY_IDX@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rcx,%rax,4), %r9d
	movq	_BY_IDX@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rcx,%rax,4), %r10d
	movq	(%rsi), %r11
	movq	8(%rsi), %r15
	movq	16(%rsi), %r13
	movl	%edx, %r14d
	cmpl	$4, %edx
	jae	LBB0_3
## %bb.2:
	xorl	%edx, %edx
	jmp	LBB0_10
LBB0_3:
	leaq	(%rdi,%r14,4), %rdx
	leaq	(%r11,%r14,4), %rax
	leaq	(%r15,%r14,4), %rcx
	leaq	(,%r14,4), %rbx
	addq	%r13, %rbx
	cmpq	%rdi, %rax
	seta	-43(%rbp)                       ## 1-byte Folded Spill
	cmpq	%rdx, %r11
	setb	%r12b
	cmpq	%rdi, %rcx
	seta	%cl
	cmpq	%rdx, %r15
	setb	-42(%rbp)                       ## 1-byte Folded Spill
	cmpq	%rdi, %rbx
	seta	%bl
	cmpq	%rdx, %r13
	setb	-41(%rbp)                       ## 1-byte Folded Spill
	movq	_RGB2YUV_SHIFT@GOTPCREL(%rip), %rsi
	leaq	4(%rsi), %rax
	cmpq	%rax, %rdi
	setb	%al
	cmpq	%rsi, %rdx
	seta	%sil
	xorl	%edx, %edx
	testb	%r12b, -43(%rbp)                ## 1-byte Folded Reload
	jne	LBB0_10
## %bb.4:
	andb	-42(%rbp), %cl                  ## 1-byte Folded Reload
	jne	LBB0_10
## %bb.5:
	andb	-41(%rbp), %bl                  ## 1-byte Folded Reload
	jne	LBB0_10
## %bb.6:
	andb	%sil, %al
	jne	LBB0_10
## %bb.7:
	movl	%r14d, %edx
	andl	$-4, %edx
	movd	%r8d, %xmm0
	pshufd	$0, %xmm0, %xmm8                ## xmm8 = xmm0[0,0,0,0]
	movd	%r9d, %xmm1
	pshufd	$0, %xmm1, %xmm9                ## xmm9 = xmm1[0,0,0,0]
	movd	%r10d, %xmm2
	pshufd	$0, %xmm2, %xmm10               ## xmm10 = xmm2[0,0,0,0]
	movq	_RGB2YUV_SHIFT@GOTPCREL(%rip), %rax
	movd	(%rax), %xmm3                   ## xmm3 = mem[0],zero,zero,zero
	pshufd	$0, %xmm3, %xmm7                ## xmm7 = xmm3[0,0,0,0]
	paddd	LCPI0_0(%rip), %xmm3
	pmovzxdq	%xmm3, %xmm4                    ## xmm4 = xmm3[0],zero,xmm3[1],zero
	movdqa	LCPI0_1(%rip), %xmm11           ## xmm11 = [2049,2049,2049,2049]
	pslld	%xmm4, %xmm11
	paddd	LCPI0_2(%rip), %xmm7
	leaq	(,%r14,4), %rax
	andq	$-16, %rax
	xorl	%ecx, %ecx
	pshufd	$238, %xmm7, %xmm6              ## xmm6 = xmm7[2,3,2,3]
	pshuflw	$254, %xmm6, %xmm4              ## xmm4 = xmm6[2,3,3,3,4,5,6,7]
	pshuflw	$254, %xmm7, %xmm5              ## xmm5 = xmm7[2,3,3,3,4,5,6,7]
	pshuflw	$84, %xmm6, %xmm6               ## xmm6 = xmm6[0,1,1,1,4,5,6,7]
	pshuflw	$84, %xmm7, %xmm7               ## xmm7 = xmm7[0,1,1,1,4,5,6,7]
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movdqu	(%r11,%rcx), %xmm0
	pmulld	%xmm9, %xmm0
	movdqu	(%r15,%rcx), %xmm1
	pmulld	%xmm10, %xmm1
	paddd	%xmm0, %xmm1
	movdqu	(%r13,%rcx), %xmm0
	pmulld	%xmm8, %xmm0
	paddd	%xmm1, %xmm0
	paddd	%xmm11, %xmm0
	movdqa	%xmm0, %xmm1
	psrad	%xmm4, %xmm1
	movdqa	%xmm0, %xmm2
	psrad	%xmm5, %xmm2
	movdqa	%xmm0, %xmm3
	psrad	%xmm6, %xmm3
	pblendw	$240, %xmm1, %xmm2              ## xmm2 = xmm2[0,1,2,3],xmm1[4,5,6,7]
	psrad	%xmm7, %xmm0
	pblendw	$240, %xmm3, %xmm0              ## xmm0 = xmm0[0,1,2,3],xmm3[4,5,6,7]
	pblendw	$204, %xmm2, %xmm0              ## xmm0 = xmm0[0,1],xmm2[2,3],xmm0[4,5],xmm2[6,7]
	movdqu	%xmm0, (%rdi,%rcx)
	addq	$16, %rcx
	cmpq	%rcx, %rax
	jne	LBB0_8
## %bb.9:
	cmpq	%r14, %rdx
	je	LBB0_12
LBB0_10:
	movq	_RGB2YUV_SHIFT@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r13,%rdx,4), %eax
	imull	%r8d, %eax
	movl	(%r11,%rdx,4), %ecx
	imull	%r9d, %ecx
	movl	(%r15,%rdx,4), %esi
	imull	%r10d, %esi
	addl	%ecx, %esi
	addl	%eax, %esi
	movzbl	(%r12), %eax
	leal	-7(%rax), %ecx
	movl	$2049, %ebx                     ## imm = 0x801
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %ebx
	addl	%esi, %ebx
	addb	$-6, %al
	movl	%eax, %ecx
	sarl	%cl, %ebx
	movl	%ebx, (%rdi,%rdx,4)
	incq	%rdx
	cmpq	%rdx, %r14
	jne	LBB0_11
LBB0_12:
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RY_IDX,8,3                     ## @RY_IDX
	.comm	_GY_IDX,8,3                     ## @GY_IDX
	.comm	_BY_IDX,8,3                     ## @BY_IDX
	.comm	_RGB2YUV_SHIFT,4,2              ## @RGB2YUV_SHIFT
	.no_dead_strip	_planar_rgb_to_y
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function planar_rgb_to_y
_planar_rgb_to_y:                       ; @planar_rgb_to_y
	.cfi_startproc
; %bb.0:
	cmp	w2, #1
	b.lt	LBB0_12
; %bb.1:
Lloh0:
	adrp	x8, _RY_IDX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RY_IDX@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	w8, [x3, x8, lsl #2]
Lloh3:
	adrp	x9, _GY_IDX@GOTPAGE
Lloh4:
	ldr	x9, [x9, _GY_IDX@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	ldr	w9, [x3, x9, lsl #2]
Lloh6:
	adrp	x10, _BY_IDX@GOTPAGE
Lloh7:
	ldr	x10, [x10, _BY_IDX@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
	ldr	w10, [x3, x10, lsl #2]
	ldp	x12, x14, [x1]
	ldr	x15, [x1, #16]
	mov	w13, w2
Lloh9:
	adrp	x11, _RGB2YUV_SHIFT@GOTPAGE
Lloh10:
	ldr	x11, [x11, _RGB2YUV_SHIFT@GOTPAGEOFF]
	cmp	w2, #16
	b.hs	LBB0_3
; %bb.2:
	mov	x16, #0
	b	LBB0_10
LBB0_3:
	mov	x16, #0
	lsl	x3, x13, #2
	add	x4, x0, x3
	add	x17, x14, x3
	cmp	x17, x0
	ccmp	x14, x4, #2, hi
	cset	w17, lo
	add	x1, x15, x3
	cmp	x1, x0
	ccmp	x15, x4, #2, hi
	cset	w1, lo
	add	x2, x11, #4
	cmp	x0, x2
	ccmp	x4, x11, #0, lo
	cset	w2, hi
	cmp	x12, x4
	add	x3, x12, x3
	ccmp	x3, x0, #0, lo
	b.hi	LBB0_10
; %bb.4:
	tbnz	w17, #0, LBB0_10
; %bb.5:
	tbnz	w1, #0, LBB0_10
; %bb.6:
	tbnz	w2, #0, LBB0_10
; %bb.7:
	and	x16, x13, #0xfffffff0
	dup.4s	v0, w8
	dup.4s	v1, w9
	dup.4s	v2, w10
	ld1r.4s	{ v4 }, [x11]
	mvni.4s	v3, #6
	add.4s	v3, v4, v3
	mov	w17, #2049
	dup.4s	v5, w17
	ushl.4s	v3, v5, v3
	mvni.4s	v5, #5
	add.4s	v4, v4, v5
	add	x17, x0, #32
	add	x1, x12, #32
	add	x2, x15, #32
	add	x3, x14, #32
	neg.4s	v4, v4
	mov	x4, x16
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldp	q5, q6, [x1, #-32]
	ldp	q7, q16, [x1], #64
	ldp	q17, q18, [x3, #-32]
	ldp	q19, q20, [x3], #64
	ldp	q21, q22, [x2, #-32]
	ldp	q23, q24, [x2], #64
	mul.4s	v5, v5, v1
	mul.4s	v6, v6, v1
	mul.4s	v7, v7, v1
	mul.4s	v16, v16, v1
	mla.4s	v5, v17, v2
	mla.4s	v6, v18, v2
	mla.4s	v7, v19, v2
	mla.4s	v16, v20, v2
	mla.4s	v5, v21, v0
	mla.4s	v6, v22, v0
	mla.4s	v7, v23, v0
	mla.4s	v16, v24, v0
	add.4s	v5, v5, v3
	add.4s	v6, v6, v3
	add.4s	v7, v7, v3
	add.4s	v16, v16, v3
	sshl.4s	v5, v5, v4
	sshl.4s	v6, v6, v4
	sshl.4s	v7, v7, v4
	sshl.4s	v16, v16, v4
	stp	q5, q6, [x17, #-32]
	stp	q7, q16, [x17], #64
	subs	x4, x4, #16
	b.ne	LBB0_8
; %bb.9:
	cmp	x16, x13
	b.eq	LBB0_12
LBB0_10:
	lsl	x1, x16, #2
	add	x17, x0, x1
	add	x15, x15, x1
	add	x14, x14, x1
	add	x12, x12, x1
	sub	x13, x13, x16
	mov	w16, #2049
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x12], #4
	ldr	w1, [x14], #4
	ldr	w2, [x15], #4
	mul	w0, w0, w9
	ldr	w3, [x11]
	sub	w4, w3, #7
	lsl	w4, w16, w4
	madd	w0, w1, w10, w0
	madd	w0, w2, w8, w0
	add	w0, w0, w4
	sub	w1, w3, #6
	asr	w0, w0, w1
	str	w0, [x17], #4
	subs	x13, x13, #1
	b.ne	LBB0_11
LBB0_12:
	ret
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_RY_IDX,8,3                     ; @RY_IDX
	.comm	_GY_IDX,8,3                     ; @GY_IDX
	.comm	_BY_IDX,8,3                     ; @BY_IDX
	.comm	_RGB2YUV_SHIFT,4,2              ; @RGB2YUV_SHIFT
	.no_dead_strip	_planar_rgb_to_y
.subsections_via_symbols
