	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function rgb12to15
LCPI0_0:
	.long	15                              ## 0xf
	.long	15                              ## 0xf
	.long	15                              ## 0xf
	.long	15                              ## 0xf
LCPI0_1:
	.long	30720                           ## 0x7800
	.long	30720                           ## 0x7800
	.long	30720                           ## 0x7800
	.long	30720                           ## 0x7800
LCPI0_2:
	.long	1024                            ## 0x400
	.long	1024                            ## 0x400
	.long	1024                            ## 0x400
	.long	1024                            ## 0x400
LCPI0_3:
	.long	960                             ## 0x3c0
	.long	960                             ## 0x3c0
	.long	960                             ## 0x3c0
	.long	960                             ## 0x3c0
LCPI0_4:
	.long	32                              ## 0x20
	.long	32                              ## 0x20
	.long	32                              ## 0x20
	.long	32                              ## 0x20
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_rgb12to15
	.p2align	4, 0x90
_rgb12to15:                             ## @rgb12to15
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	cmpl	$2, %edx
	jl	LBB0_8
## %bb.1:
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	cltq
	leaq	(%rdi,%rax,4), %r9
	leaq	4(%rdi), %rax
	cmpq	%rax, %r9
	cmovaq	%r9, %rax
	movq	%rdi, %r8
	notq	%r8
	addq	%rax, %r8
	cmpq	$28, %r8
	jb	LBB0_2
## %bb.3:
	movq	%rsi, %rax
	subq	%rdi, %rax
	cmpq	$32, %rax
	jb	LBB0_2
## %bb.4:
	shrq	$2, %r8
	incq	%r8
	movq	%r8, %r10
	andq	$-8, %r10
	leaq	(%rsi,%r10,4), %r11
	leaq	(%rdi,%r10,4), %r14
	xorl	%eax, %eax
	movdqa	LCPI0_0(%rip), %xmm8            ## xmm8 = [15,15,15,15]
	movdqa	LCPI0_1(%rip), %xmm9            ## xmm9 = [30720,30720,30720,30720]
	movdqa	LCPI0_2(%rip), %xmm10           ## xmm10 = [1024,1024,1024,1024]
	movdqa	LCPI0_3(%rip), %xmm11           ## xmm11 = [960,960,960,960]
	movdqa	LCPI0_4(%rip), %xmm12           ## xmm12 = [32,32,32,32]
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movdqu	(%rdi,%rax,4), %xmm5
	movdqu	16(%rdi,%rax,4), %xmm1
	movdqa	%xmm5, %xmm0
	pand	%xmm8, %xmm0
	movdqa	%xmm1, %xmm6
	pand	%xmm8, %xmm6
	movdqa	%xmm5, %xmm3
	pslld	$3, %xmm3
	movdqa	%xmm1, %xmm7
	pslld	$3, %xmm7
	pand	%xmm9, %xmm3
	pand	%xmm9, %xmm7
	movdqa	%xmm5, %xmm2
	psrld	$1, %xmm2
	movdqa	%xmm1, %xmm4
	psrld	$1, %xmm4
	pand	%xmm10, %xmm2
	por	%xmm3, %xmm2
	pand	%xmm10, %xmm4
	por	%xmm7, %xmm4
	movdqa	%xmm5, %xmm3
	pslld	$2, %xmm3
	movdqa	%xmm1, %xmm7
	pslld	$2, %xmm7
	pand	%xmm11, %xmm3
	pand	%xmm11, %xmm7
	psrld	$2, %xmm5
	psrld	$2, %xmm1
	pand	%xmm12, %xmm5
	por	%xmm3, %xmm5
	pand	%xmm12, %xmm1
	por	%xmm7, %xmm1
	movdqa	%xmm0, %xmm3
	paddd	%xmm0, %xmm3
	movdqa	%xmm6, %xmm7
	paddd	%xmm6, %xmm7
	psrld	$3, %xmm0
	por	%xmm3, %xmm0
	por	%xmm5, %xmm0
	por	%xmm2, %xmm0
	psrld	$3, %xmm6
	por	%xmm7, %xmm6
	por	%xmm1, %xmm6
	por	%xmm4, %xmm6
	movdqu	%xmm0, (%rsi,%rax,4)
	movdqu	%xmm6, 16(%rsi,%rax,4)
	addq	$8, %rax
	cmpq	%rax, %r10
	jne	LBB0_5
## %bb.6:
	cmpq	%r10, %r8
	jne	LBB0_7
	jmp	LBB0_8
LBB0_2:
	movq	%rsi, %r11
	movq	%rdi, %r14
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %eax
	addq	$4, %r14
	movl	%eax, %ebx
	andl	$15, %ebx
	movl	%eax, %edi
	andl	$3840, %edi                     ## imm = 0xF00
	movl	%eax, %ecx
	shrl	%ecx
	andl	$1024, %ecx                     ## imm = 0x400
	movl	%eax, %edx
	andl	$240, %edx
	shrl	$2, %eax
	andl	$32, %eax
	movl	%ebx, %esi
	shrl	$3, %esi
	leal	(%rsi,%rbx,2), %esi
	orl	%eax, %esi
	leal	(%rsi,%rdx,4), %eax
	orl	%ecx, %eax
	leal	(%rax,%rdi,8), %eax
	movl	%eax, (%r11)
	addq	$4, %r11
	cmpq	%r9, %r14
	jb	LBB0_7
LBB0_8:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rgb12to15                      ; -- Begin function rgb12to15
	.p2align	2
_rgb12to15:                             ; @rgb12to15
	.cfi_startproc
; %bb.0:
	stp	d13, d12, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	d11, d10, [sp, #16]             ; 16-byte Folded Spill
	stp	d9, d8, [sp, #32]               ; 16-byte Folded Spill
	.cfi_offset b8, -8
	.cfi_offset b9, -16
	.cfi_offset b10, -24
	.cfi_offset b11, -32
	.cfi_offset b12, -40
	.cfi_offset b13, -48
	cmp	w2, #0
	cinc	w10, w2, lt
	cmp	w2, #2
	b.lt	LBB0_9
; %bb.1:
	sbfx	x8, x10, #1, #31
	add	x8, x0, x8, lsl #2
	add	x9, x0, #4
	cmp	x8, x9
	csel	x8, x8, x9, hi
	mvn	x9, x0
	add	x8, x8, x9
	cmp	x8, #60
	b.lo	LBB0_6
; %bb.2:
	sub	x9, x1, x0
	cmp	x9, #64
	b.lo	LBB0_6
; %bb.3:
	lsr	x8, x8, #2
	add	x11, x8, #1
	and	x12, x11, #0x7ffffffffffffff0
	lsl	x9, x12, #2
	add	x8, x1, x9
	add	x9, x0, x9
	add	x13, x1, #32
	add	x14, x0, #32
	movi.4s	v0, #15
	movi.4s	v1, #120, lsl #8
	movi.4s	v2, #4, lsl #8
	mov	w15, #960
	dup.4s	v3, w15
	movi.4s	v4, #32
	mov	x15, x12
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldp	q5, q6, [x14, #-32]
	and.16b	v7, v5, v0
	and.16b	v16, v6, v0
	ldp	q17, q18, [x14], #64
	and.16b	v19, v17, v0
	and.16b	v20, v18, v0
	shl.4s	v21, v5, #3
	shl.4s	v22, v6, #3
	shl.4s	v23, v17, #3
	shl.4s	v24, v18, #3
	and.16b	v21, v21, v1
	and.16b	v22, v22, v1
	and.16b	v23, v23, v1
	and.16b	v24, v24, v1
	ushr.4s	v25, v5, #1
	ushr.4s	v26, v6, #1
	ushr.4s	v27, v17, #1
	ushr.4s	v28, v18, #1
	and.16b	v25, v25, v2
	and.16b	v26, v26, v2
	and.16b	v27, v27, v2
	and.16b	v28, v28, v2
	shl.4s	v29, v5, #2
	shl.4s	v30, v6, #2
	shl.4s	v31, v17, #2
	shl.4s	v8, v18, #2
	and.16b	v29, v29, v3
	and.16b	v30, v30, v3
	and.16b	v31, v31, v3
	and.16b	v8, v8, v3
	ushr.4s	v5, v5, #2
	ushr.4s	v6, v6, #2
	ushr.4s	v17, v17, #2
	ushr.4s	v18, v18, #2
	and.16b	v5, v5, v4
	and.16b	v6, v6, v4
	and.16b	v17, v17, v4
	and.16b	v18, v18, v4
	shl.4s	v9, v7, #1
	shl.4s	v10, v16, #1
	shl.4s	v11, v19, #1
	shl.4s	v12, v20, #1
	ushr.4s	v7, v7, #3
	ushr.4s	v16, v16, #3
	ushr.4s	v19, v19, #3
	ushr.4s	v20, v20, #3
	orr.16b	v7, v9, v7
	orr.16b	v16, v10, v16
	orr.16b	v19, v11, v19
	orr.16b	v20, v12, v20
	orr.16b	v5, v7, v5
	orr.16b	v6, v16, v6
	orr.16b	v7, v19, v17
	orr.16b	v16, v20, v18
	orr.16b	v5, v5, v29
	orr.16b	v6, v6, v30
	orr.16b	v7, v7, v31
	orr.16b	v16, v16, v8
	orr.16b	v5, v5, v25
	orr.16b	v6, v6, v26
	orr.16b	v5, v5, v21
	orr.16b	v6, v6, v22
	stp	q5, q6, [x13, #-32]
	orr.16b	v5, v7, v27
	orr.16b	v6, v16, v28
	orr.16b	v5, v5, v23
	orr.16b	v6, v6, v24
	stp	q5, q6, [x13], #64
	subs	x15, x15, #16
	b.ne	LBB0_4
; %bb.5:
	cmp	x11, x12
	b.ne	LBB0_7
	b	LBB0_9
LBB0_6:
	mov	x8, x1
	mov	x9, x0
LBB0_7:
	asr	w10, w10, #1
	add	x10, x0, w10, sxtw #2
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x9], #4
	lsr	w12, w11, #8
	lsr	w13, w11, #4
	and	w14, w11, #0xf
	lsr	w15, w11, #1
	and	w15, w15, #0x400
	lsr	w16, w11, #2
	and	w16, w16, #0x20
	ubfx	w11, w11, #3, #1
	bfi	w11, w14, #1, #4
	orr	w11, w11, w16
	bfi	w11, w13, #6, #4
	orr	w11, w11, w15
	bfi	w11, w12, #11, #4
	str	w11, [x8], #4
	cmp	x9, x10
	b.lo	LBB0_8
LBB0_9:
	ldp	d9, d8, [sp, #32]               ; 16-byte Folded Reload
	ldp	d11, d10, [sp, #16]             ; 16-byte Folded Reload
	ldp	d13, d12, [sp], #48             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
