	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function rgb24ToY_c
LCPI0_0:
	.long	32                              ## 0x20
	.long	32                              ## 0x20
	.long	32                              ## 0x20
	.long	32                              ## 0x20
LCPI0_1:
	.long	4294967289                      ## 0xfffffff9
	.long	4294967289                      ## 0xfffffff9
	.long	4294967289                      ## 0xfffffff9
	.long	4294967289                      ## 0xfffffff9
LCPI0_2:
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.long	1                               ## 0x1
LCPI0_3:
	.long	4294967290                      ## 0xfffffffa
	.long	4294967290                      ## 0xfffffffa
	.long	4294967290                      ## 0xfffffffa
	.long	4294967290                      ## 0xfffffffa
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_rgb24ToY_c:                            ## @rgb24ToY_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testl	%r8d, %r8d
	jle	LBB0_10
## %bb.1:
	movq	_RY_IDX@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%r9,%rax,4), %r10d
	movq	_GY_IDX@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%r9,%rax,4), %r11d
	movq	_BY_IDX@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%r9,%rax,4), %r9d
	movl	%r8d, %r14d
	cmpl	$4, %r8d
	jae	LBB0_3
## %bb.2:
	xorl	%r12d, %r12d
	jmp	LBB0_8
LBB0_3:
	leaq	(%rdi,%r14,4), %rdx
	leaq	(%r14,%r14,2), %rax
	leaq	(%rsi,%rax,4), %rax
	cmpq	%rdi, %rax
	seta	%al
	cmpq	%rsi, %rdx
	seta	%bl
	movq	_RGB2YUV_SHIFT@GOTPCREL(%rip), %r8
	leaq	4(%r8), %rcx
	cmpq	%rcx, %rdi
	setb	%cl
	cmpq	%r8, %rdx
	seta	%r15b
	xorl	%r12d, %r12d
	testb	%bl, %al
	jne	LBB0_8
## %bb.4:
	andb	%r15b, %cl
	jne	LBB0_8
## %bb.5:
	movl	%r14d, %r12d
	andl	$-4, %r12d
	movd	%r10d, %xmm0
	pshufd	$0, %xmm0, %xmm8                ## xmm8 = xmm0[0,0,0,0]
	movd	%r11d, %xmm0
	pshufd	$0, %xmm0, %xmm10               ## xmm10 = xmm0[0,0,0,0]
	movd	%r9d, %xmm0
	pshufd	$0, %xmm0, %xmm11               ## xmm11 = xmm0[0,0,0,0]
	movd	(%r8), %xmm0                    ## xmm0 = mem[0],zero,zero,zero
	pshufd	$0, %xmm0, %xmm9                ## xmm9 = xmm0[0,0,0,0]
	pcmpeqd	%xmm3, %xmm3
	paddd	%xmm0, %xmm3
	pmovzxdq	%xmm3, %xmm4                    ## xmm4 = xmm3[0],zero,xmm3[1],zero
	movdqa	LCPI0_0(%rip), %xmm12           ## xmm12 = [32,32,32,32]
	pslld	%xmm4, %xmm12
	paddd	LCPI0_1(%rip), %xmm0
	pmovzxdq	%xmm0, %xmm0                    ## xmm0 = xmm0[0],zero,xmm0[1],zero
	movdqa	LCPI0_2(%rip), %xmm13           ## xmm13 = [1,1,1,1]
	pslld	%xmm0, %xmm13
	paddd	LCPI0_3(%rip), %xmm9
	leaq	(,%r14,4), %r8
	andq	$-16, %r8
	xorl	%ecx, %ecx
	pshufd	$238, %xmm9, %xmm0              ## xmm0 = xmm9[2,3,2,3]
	pshuflw	$254, %xmm0, %xmm14             ## xmm14 = xmm0[2,3,3,3,4,5,6,7]
	pshuflw	$254, %xmm9, %xmm15             ## xmm15 = xmm9[2,3,3,3,4,5,6,7]
	pshuflw	$84, %xmm0, %xmm7               ## xmm7 = xmm0[0,1,1,1,4,5,6,7]
	pshuflw	$84, %xmm9, %xmm0               ## xmm0 = xmm9[0,1,1,1,4,5,6,7]
	movq	%rsi, %rax
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movdqu	(%rax), %xmm1
	movdqu	16(%rax), %xmm4
	movups	32(%rax), %xmm3
	movdqa	%xmm4, %xmm2
	pblendw	$12, %xmm1, %xmm2               ## xmm2 = xmm2[0,1],xmm1[2,3],xmm2[4,5,6,7]
	pshufd	$238, %xmm1, %xmm5              ## xmm5 = xmm1[2,3,2,3]
	shufps	$236, %xmm4, %xmm1              ## xmm1 = xmm1[0,3],xmm4[2,3]
	insertps	$112, %xmm3, %xmm1              ## xmm1 = xmm1[0,1,2],xmm3[1]
	pmulld	%xmm8, %xmm1
	pshufd	$170, %xmm3, %xmm6              ## xmm6 = xmm3[2,2,2,2]
	pshufd	$241, %xmm2, %xmm2              ## xmm2 = xmm2[1,0,3,3]
	pblendw	$192, %xmm6, %xmm2              ## xmm2 = xmm2[0,1,2,3,4,5],xmm6[6,7]
	pmulld	%xmm10, %xmm2
	paddd	%xmm1, %xmm2
	pblendw	$12, %xmm4, %xmm5               ## xmm5 = xmm5[0,1],xmm4[2,3],xmm5[4,5,6,7]
	shufps	$196, %xmm3, %xmm5              ## xmm5 = xmm5[0,1],xmm3[0,3]
	pmulld	%xmm11, %xmm5
	paddd	%xmm2, %xmm5
	paddd	%xmm12, %xmm5
	paddd	%xmm13, %xmm5
	movdqa	%xmm5, %xmm1
	psrad	%xmm14, %xmm1
	movdqa	%xmm5, %xmm2
	psrad	%xmm15, %xmm2
	pblendw	$240, %xmm1, %xmm2              ## xmm2 = xmm2[0,1,2,3],xmm1[4,5,6,7]
	movdqa	%xmm5, %xmm1
	psrad	%xmm7, %xmm1
	psrad	%xmm0, %xmm5
	pblendw	$240, %xmm1, %xmm5              ## xmm5 = xmm5[0,1,2,3],xmm1[4,5,6,7]
	pblendw	$204, %xmm2, %xmm5              ## xmm5 = xmm5[0,1],xmm2[2,3],xmm5[4,5],xmm2[6,7]
	movdqu	%xmm5, (%rdi,%rcx)
	addq	$48, %rax
	addq	$16, %rcx
	cmpq	%rcx, %r8
	jne	LBB0_6
## %bb.7:
	cmpq	%r14, %r12
	je	LBB0_10
LBB0_8:
	leaq	(%r12,%r12,2), %rax
	leaq	(%rsi,%rax,4), %r15
	addq	$8, %r15
	movq	_RGB2YUV_SHIFT@GOTPCREL(%rip), %r8
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	-8(%r15), %eax
	imull	%r10d, %eax
	movl	-4(%r15), %ebx
	imull	%r11d, %ebx
	addl	%eax, %ebx
	movl	(%r15), %edx
	imull	%r9d, %edx
	movzbl	(%r8), %eax
	leal	-1(%rax), %ecx
	movl	$32, %esi
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %esi
	addl	%ebx, %edx
	addl	%edx, %esi
	leal	-7(%rax), %ecx
	movl	$1, %edx
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %edx
	addl	%esi, %edx
	addb	$-6, %al
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, (%rdi,%r12,4)
	incq	%r12
	addq	$12, %r15
	cmpq	%r12, %r14
	jne	LBB0_9
LBB0_10:
	popq	%rbx
	popq	%r12
	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	_rgb24ToY_c
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rgb24ToY_c
_rgb24ToY_c:                            ; @rgb24ToY_c
	.cfi_startproc
; %bb.0:
	cmp	w4, #1
	b.lt	LBB0_10
; %bb.1:
Lloh0:
	adrp	x8, _RY_IDX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RY_IDX@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	w8, [x5, x8, lsl #2]
Lloh3:
	adrp	x9, _GY_IDX@GOTPAGE
Lloh4:
	ldr	x9, [x9, _GY_IDX@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	ldr	w9, [x5, x9, lsl #2]
Lloh6:
	adrp	x10, _BY_IDX@GOTPAGE
Lloh7:
	ldr	x10, [x10, _BY_IDX@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
	ldr	w10, [x5, x10, lsl #2]
	mov	w12, w4
Lloh9:
	adrp	x11, _RGB2YUV_SHIFT@GOTPAGE
Lloh10:
	ldr	x11, [x11, _RGB2YUV_SHIFT@GOTPAGEOFF]
	cmp	w4, #4
	b.hs	LBB0_3
; %bb.2:
	mov	x13, #0
	b	LBB0_8
LBB0_3:
	mov	x13, #0
	add	x15, x0, x12, lsl #2
	mov	w14, #12
	madd	x16, x12, x14, x1
	add	x14, x11, #4
	cmp	x0, x14
	ccmp	x15, x11, #0, lo
	cset	w14, hi
	cmp	x15, x1
	ccmp	x16, x0, #0, hi
	b.hi	LBB0_8
; %bb.4:
	tbnz	w14, #0, LBB0_8
; %bb.5:
	and	x13, x12, #0xfffffffc
	dup.4s	v0, w8
	dup.4s	v1, w9
	dup.4s	v2, w10
	ld1r.4s	{ v5 }, [x11]
	movi.2d	v3, #0xffffffffffffffff
	add.4s	v3, v5, v3
	movi.4s	v4, #32
	ushl.4s	v3, v4, v3
	mvni.4s	v4, #6
	add.4s	v4, v5, v4
	movi.4s	v6, #1
	ushl.4s	v4, v6, v4
	mvni.4s	v6, #5
	add.4s	v5, v5, v6
	neg.4s	v5, v5
	mov	x14, x13
	mov	x15, x0
	mov	x16, x1
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ld3.4s	{ v16, v17, v18 }, [x16], #48
	mul.4s	v6, v16, v0
	mla.4s	v6, v17, v1
	mla.4s	v6, v18, v2
	add.4s	v6, v6, v3
	add.4s	v6, v6, v4
	sshl.4s	v6, v6, v5
	str	q6, [x15], #16
	subs	x14, x14, #4
	b.ne	LBB0_6
; %bb.7:
	cmp	x13, x12
	b.eq	LBB0_10
LBB0_8:
	mov	w14, #12
	madd	x14, x13, x14, x1
	add	x14, x14, #8
	add	x15, x0, x13, lsl #2
	sub	x12, x12, x13
	mov	w13, #32
	mov	w16, #1
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldp	w17, w0, [x14, #-8]
	ldr	w1, [x14], #12
	mul	w17, w17, w8
	mul	w0, w0, w9
	mul	w1, w1, w10
	add	w17, w0, w17
	add	w17, w17, w1
	ldr	w0, [x11]
	sub	w1, w0, #1
	lsl	w1, w13, w1
	sub	w2, w0, #7
	lsl	w2, w16, w2
	add	w17, w17, w1
	add	w17, w17, w2
	sub	w0, w0, #6
	asr	w17, w17, w0
	str	w17, [x15], #4
	subs	x12, x12, #1
	b.ne	LBB0_9
LBB0_10:
	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	_rgb24ToY_c
.subsections_via_symbols
