	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function rgb16tobgr16
LCPI0_0:
	.long	2016                            ## 0x7e0
	.long	2016                            ## 0x7e0
	.long	2016                            ## 0x7e0
	.long	2016                            ## 0x7e0
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_rgb16tobgr16
	.p2align	4, 0x90
_rgb16tobgr16:                          ## @rgb16tobgr16
	.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 = [2016,2016,2016,2016]
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movdqu	(%rdi,%rax), %xmm1
	movdqu	16(%rdi,%rax), %xmm2
	movdqa	%xmm1, %xmm3
	psrld	$11, %xmm3
	movdqa	%xmm2, %xmm4
	psrld	$11, %xmm4
	movdqa	%xmm1, %xmm5
	pand	%xmm0, %xmm5
	por	%xmm3, %xmm5
	movdqa	%xmm2, %xmm3
	pand	%xmm0, %xmm3
	por	%xmm4, %xmm3
	pslld	$11, %xmm1
	por	%xmm5, %xmm1
	pslld	$11, %xmm2
	por	%xmm3, %xmm2
	movdqu	%xmm1, (%rsi,%rax)
	movdqu	%xmm2, 16(%rsi,%rax)
	addq	$32, %rax
	cmpq	%rax, %rdx
	jne	LBB0_4
## %bb.5:
	cmpq	%r8, %r11
	je	LBB0_10
LBB0_6:
	movq	%r11, %rax
	notq	%rax
	testb	$1, %r8b
	je	LBB0_8
## %bb.7:
	movl	(%rdi,%r11,4), %edx
	movl	%edx, %r9d
	shrl	$11, %r9d
	movl	%edx, %r10d
	andl	$2016, %r10d                    ## imm = 0x7E0
	orl	%r9d, %r10d
	shll	$11, %edx
	orl	%r10d, %edx
	movl	%edx, (%rsi,%r11,4)
	orq	$1, %r11
LBB0_8:
	addq	%r8, %rax
	je	LBB0_10
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rdi,%r11,4), %eax
	movl	%eax, %edx
	shrl	$11, %edx
	movl	%eax, %ecx
	andl	$2016, %ecx                     ## imm = 0x7E0
	orl	%edx, %ecx
	shll	$11, %eax
	orl	%ecx, %eax
	movl	%eax, (%rsi,%r11,4)
	movl	4(%rdi,%r11,4), %eax
	movl	%eax, %ecx
	shrl	$11, %ecx
	movl	%eax, %edx
	andl	$2016, %edx                     ## imm = 0x7E0
	orl	%ecx, %edx
	shll	$11, %eax
	orl	%edx, %eax
	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	_rgb16tobgr16                   ; -- Begin function rgb16tobgr16
	.p2align	2
_rgb16tobgr16:                          ; @rgb16tobgr16
	.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
	mov	w12, #2016
	dup.4s	v0, w12
	mov	x12, x9
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldp	q1, q2, [x11, #-32]
	ldp	q3, q4, [x11], #64
	ushr.4s	v5, v1, #11
	ushr.4s	v6, v2, #11
	ushr.4s	v7, v3, #11
	ushr.4s	v16, v4, #11
	and.16b	v17, v1, v0
	and.16b	v18, v2, v0
	and.16b	v19, v3, v0
	and.16b	v20, v4, v0
	orr.16b	v5, v5, v17
	orr.16b	v6, v6, v18
	orr.16b	v7, v7, v19
	orr.16b	v16, v16, v20
	shl.4s	v1, v1, #11
	shl.4s	v2, v2, #11
	shl.4s	v3, v3, #11
	shl.4s	v4, v4, #11
	orr.16b	v1, v5, v1
	orr.16b	v2, v6, v2
	orr.16b	v3, v7, v3
	stp	q1, q2, [x10, #-32]
	orr.16b	v1, v16, v4
	stp	q3, q1, [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, #0x7e0
	orr	w12, w12, w9, lsr #11
	orr	w9, w12, w9, lsl #11
	str	w9, [x10], #4
	subs	x8, x8, #1
	b.ne	LBB0_7
LBB0_8:
	ret
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
