	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function RGBAtoYCoCgA
_RGBAtoYCoCgA:                          ## @RGBAtoYCoCgA
	.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
                                        ## kill: def $edx killed $edx def $rdx
	testl	%ecx, %ecx
	jle	LBB0_6
## %bb.1:
	leal	(,%rdx,4), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%ecx, %r9d
	xorl	%r10d, %r10d
	xorl	%r11d, %r11d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%r11
	addl	-44(%rbp), %r10d                ## 4-byte Folded Reload
	cmpq	%r9, %r11
	je	LBB0_6
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	testl	%edx, %edx
	jle	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movslq	%r10d, %rax
	shlq	$2, %rax
	movl	%edx, %r14d
	.p2align	4, 0x90
LBB0_4:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%rdi,%rax), %ebx
	movl	4(%rdi,%rax), %ecx
	movl	8(%rdi,%rax), %r15d
	movl	12(%rdi,%rax), %r12d
	leal	(%r15,%rbx), %r13d
	sarl	%r13d
	leal	(%rcx,%r13), %r8d
	sarl	%r8d
	movl	%r8d, (%rsi,%rax)
	subl	%r15d, %ebx
	addl	$256, %ebx                      ## imm = 0x100
	sarl	%ebx
	movl	%ebx, 4(%rsi,%rax)
	subl	%r13d, %ecx
	addl	$256, %ecx                      ## imm = 0x100
	sarl	%ecx
	movl	%ecx, 8(%rsi,%rax)
	movl	%r12d, 12(%rsi,%rax)
	addq	$16, %rax
	decl	%r14d
	jne	LBB0_4
	jmp	LBB0_5
LBB0_6:
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_RGBAtoYCoCgA
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function RGBAtoYCoCgA
_RGBAtoYCoCgA:                          ; @RGBAtoYCoCgA
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	.cfi_offset w19, -8
	.cfi_offset w20, -16
	.cfi_offset w21, -24
	.cfi_offset w22, -32
	cmp	w3, #1
	b.lt	LBB0_11
; %bb.1:
	mov	w8, #0
	mov	x9, #0
	lsl	w10, w2, #2
	mov	w11, w3
	sub	w12, w2, #1
	lsl	x13, x12, #4
	add	x14, x13, #16
	add	x15, x1, x14
	add	x13, x12, #1
	add	x14, x0, x14
	cmp	x14, x1
	ccmp	x15, x0, #0, hi
	cset	w14, hi
	and	x15, x13, #0x1fffffffc
	lsl	x16, x15, #2
	movi.4s	v0, #1, lsl #8
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x9, x9, #1
	add	w8, w8, w10
	cmp	x9, x11
	b.eq	LBB0_11
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
                                        ;     Child Loop BB0_10 Depth 2
	cmp	w2, #1
	b.lt	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	cmp	w12, #3
	cset	w4, lo
	mul	w17, w10, w9
	sbfiz	x3, x17, #2, #32
	add	x17, x1, x3
	add	x3, x0, x3
	orr	w4, w4, w14
	tbz	w4, #0, LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w4, #0
	b	LBB0_9
LBB0_6:                                 ;   in Loop: Header=BB0_3 Depth=1
	sbfiz	x5, x8, #2, #32
	add	x4, x1, x5
	add	x5, x0, x5
	add	x3, x3, x16, lsl #2
	mov	x6, x15
	add	x17, x17, x16, lsl #2
LBB0_7:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ld4.4s	{ v1, v2, v3, v4 }, [x5], #64
	add.4s	v5, v3, v1
	sshr.4s	v6, v5, #1
	sub.4s	v6, v2, v6
	ssra.4s	v2, v5, #1
	sshr.4s	v16, v2, #1
	sub.4s	v5, v1, v3
	add.4s	v5, v5, v0
	sshr.4s	v17, v5, #1
	add.4s	v5, v6, v0
	sshr.4s	v18, v5, #1
	mov.16b	v19, v4
	st4.4s	{ v16, v17, v18, v19 }, [x4], #64
	subs	x6, x6, #4
	b.ne	LBB0_7
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x4, x15
	cmp	x13, x15
	b.eq	LBB0_2
LBB0_9:                                 ;   in Loop: Header=BB0_3 Depth=1
	sub	w4, w2, w4
LBB0_10:                                ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldp	w5, w6, [x3]
	ldp	w7, w19, [x3, #8]
	add	w20, w7, w5
	asr	w20, w20, #1
	add	w21, w20, w6
	asr	w21, w21, #1
	sub	w5, w5, w7
	add	w5, w5, #256
	asr	w5, w5, #1
	stp	w21, w5, [x17]
	sub	w5, w6, w20
	add	w5, w5, #256
	asr	w5, w5, #1
	stp	w5, w19, [x17, #8]
	add	x3, x3, #16
	add	x17, x17, #16
	subs	w4, w4, #1
	b.ne	LBB0_10
	b	LBB0_2
LBB0_11:
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #32             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_RGBAtoYCoCgA
.subsections_via_symbols
