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