	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function rgb12tobgr12
LCPI0_0:
	.long	240                             ## 0xf0
	.long	240                             ## 0xf0
	.long	240                             ## 0xf0
	.long	240                             ## 0xf0
LCPI0_1:
	.long	4095                            ## 0xfff
	.long	4095                            ## 0xfff
	.long	4095                            ## 0xfff
	.long	4095                            ## 0xfff
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_rgb12tobgr12
	.p2align	4, 0x90
_rgb12tobgr12:                          ## @rgb12tobgr12
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
                                        ## kill: def $edx killed $edx def $rdx
	cmpl	$2, %edx
	jl	LBB0_10
## %bb.1:
	movl	%edx, %r8d
	shrl	%r8d
	xorl	%r11d, %r11d
	cmpl	$16, %edx
	jb	LBB0_6
## %bb.2:
	movq	%rsi, %rax
	subq	%rdi, %rax
	cmpq	$32, %rax
	jb	LBB0_6
## %bb.3:
	movl	%r8d, %r11d
	andl	$-8, %r11d
	andl	$-16, %edx
	addq	%rdx, %rdx
	xorl	%eax, %eax
	movdqa	LCPI0_0(%rip), %xmm0            ## xmm0 = [240,240,240,240]
	movdqa	LCPI0_1(%rip), %xmm1            ## xmm1 = [4095,4095,4095,4095]
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movdqu	(%rdi,%rax), %xmm2
	movdqu	16(%rdi,%rax), %xmm3
	movdqa	%xmm2, %xmm4
	pslld	$8, %xmm4
	movdqa	%xmm3, %xmm5
	pslld	$8, %xmm5
	movdqa	%xmm2, %xmm6
	pand	%xmm0, %xmm6
	por	%xmm4, %xmm6
	movdqa	%xmm3, %xmm4
	pand	%xmm0, %xmm4
	por	%xmm5, %xmm4
	psrld	$8, %xmm2
	por	%xmm6, %xmm2
	psrld	$8, %xmm3
	por	%xmm4, %xmm3
	pand	%xmm1, %xmm2
	pand	%xmm1, %xmm3
	movdqu	%xmm2, (%rsi,%rax)
	movdqu	%xmm3, 16(%rsi,%rax)
	addq	$32, %rax
	cmpq	%rax, %rdx
	jne	LBB0_4
## %bb.5:
	cmpq	%r8, %r11
	je	LBB0_10
LBB0_6:
	movq	%r11, %r10
	notq	%r10
	testb	$1, %r8b
	je	LBB0_8
## %bb.7:
	movl	(%rdi,%r11,4), %edx
	movl	%edx, %r9d
	shll	$8, %r9d
	movl	%edx, %eax
	andl	$240, %eax
	orl	%r9d, %eax
	shrl	$8, %edx
	orl	%eax, %edx
	andl	$4095, %edx                     ## imm = 0xFFF
	movl	%edx, (%rsi,%r11,4)
	orq	$1, %r11
LBB0_8:
	addq	%r8, %r10
	je	LBB0_10
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rdi,%r11,4), %eax
	movl	%eax, %edx
	shll	$8, %edx
	movl	%eax, %ecx
	andl	$240, %ecx
	orl	%edx, %ecx
	shrl	$8, %eax
	orl	%ecx, %eax
	andl	$4095, %eax                     ## imm = 0xFFF
	movl	%eax, (%rsi,%r11,4)
	movl	4(%rdi,%r11,4), %eax
	movl	%eax, %ecx
	shll	$8, %ecx
	movl	%eax, %edx
	andl	$240, %edx
	orl	%ecx, %edx
	shrl	$8, %eax
	orl	%edx, %eax
	andl	$4095, %eax                     ## imm = 0xFFF
	movl	%eax, 4(%rsi,%r11,4)
	addq	$2, %r11
	cmpq	%r11, %r8
	jne	LBB0_9
LBB0_10:
	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	_rgb12tobgr12                   ; -- Begin function rgb12tobgr12
	.p2align	2
_rgb12tobgr12:                          ; @rgb12tobgr12
	.cfi_startproc
; %bb.0:
	cmp	w2, #2
	b.lt	LBB0_8
; %bb.1:
	mov	x9, #0
	lsr	w8, w2, #1
	cmp	w2, #32
	b.lo	LBB0_6
; %bb.2:
	sub	x10, x1, x0
	cmp	x10, #64
	b.lo	LBB0_6
; %bb.3:
	and	x9, x8, #0x7ffffff0
	add	x10, x1, #32
	add	x11, x0, #32
	movi.4s	v0, #240
	movi.4s	v1, #15, msl #8
	mov	x12, x9
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldp	q2, q3, [x11, #-32]
	ldp	q4, q5, [x11], #64
	shl.4s	v6, v2, #8
	shl.4s	v7, v3, #8
	shl.4s	v16, v4, #8
	shl.4s	v17, v5, #8
	and.16b	v18, v2, v0
	and.16b	v19, v3, v0
	and.16b	v20, v4, v0
	and.16b	v21, v5, v0
	orr.16b	v6, v6, v18
	orr.16b	v7, v7, v19
	orr.16b	v16, v16, v20
	orr.16b	v17, v17, v21
	ushr.4s	v2, v2, #8
	ushr.4s	v3, v3, #8
	ushr.4s	v4, v4, #8
	ushr.4s	v5, v5, #8
	orr.16b	v2, v6, v2
	orr.16b	v3, v7, v3
	orr.16b	v4, v16, v4
	orr.16b	v5, v17, v5
	and.16b	v2, v2, v1
	and.16b	v3, v3, v1
	and.16b	v4, v4, v1
	stp	q2, q3, [x10, #-32]
	and.16b	v2, v5, v1
	stp	q4, q2, [x10], #64
	subs	x12, x12, #16
	b.ne	LBB0_4
; %bb.5:
	cmp	x9, x8
	b.eq	LBB0_8
LBB0_6:
	lsl	x11, x9, #2
	add	x10, x1, x11
	add	x11, x0, x11
	sub	x8, x8, x9
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w9, [x11], #4
	and	w12, w9, #0xf0
	bfi	w12, w9, #8, #24
	orr	w9, w12, w9, lsr #8
	and	w9, w9, #0xfff
	str	w9, [x10], #4
	subs	x8, x8, #1
	b.ne	LBB0_7
LBB0_8:
	ret
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
