	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function rgb24tobgr15_c
LCPI0_0:
	.long	992                             ## 0x3e0
	.long	992                             ## 0x3e0
	.long	992                             ## 0x3e0
	.long	992                             ## 0x3e0
LCPI0_1:
	.long	31744                           ## 0x7c00
	.long	31744                           ## 0x7c00
	.long	31744                           ## 0x7c00
	.long	31744                           ## 0x7c00
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_rgb24tobgr15_c:                        ## @rgb24tobgr15_c
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	.cfi_offset %rbx, -24
	testl	%edx, %edx
	jle	LBB0_9
## %bb.1:
	movslq	%edx, %rax
	leaq	(%rdi,%rax,4), %r10
	leaq	12(%rdi), %r9
	cmpq	%r9, %r10
	movq	%r9, %rax
	cmovaq	%r10, %rax
	addq	$-12, %rax
	xorl	%ecx, %ecx
	cmpq	%rdi, %rax
	setne	%cl
	subq	%rdi, %rax
	subq	%rcx, %rax
	movabsq	$-6148914691236517205, %r11     ## imm = 0xAAAAAAAAAAAAAAAB
	mulq	%r11
	movq	%rdx, %r8
	shrq	$3, %r8
	leaq	(%r8,%rcx), %rax
	cmpq	$3, %rax
	jb	LBB0_2
## %bb.3:
	cmpq	%r9, %r10
	cmovaq	%r10, %r9
	addq	$-12, %r9
	xorl	%ebx, %ebx
	cmpq	%rdi, %r9
	setne	%bl
	subq	%rdi, %r9
	subq	%rbx, %r9
	movq	%r9, %rax
	mulq	%r11
	shrq	$3, %rdx
	addq	%rbx, %rdx
	leaq	(%rdx,%rdx,2), %rax
	leaq	(%rdi,%rax,4), %rax
	addq	$12, %rax
	cmpq	%rsi, %rax
	jbe	LBB0_5
## %bb.4:
	leaq	(%rsi,%rdx,4), %rax
	addq	$4, %rax
	cmpq	%rdi, %rax
	jbe	LBB0_5
LBB0_2:
	movq	%rsi, %rax
	movq	%rdi, %rdx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rdx), %ecx
	movl	4(%rdx), %esi
	movl	8(%rdx), %edi
	sarl	$3, %ecx
	shll	$2, %esi
	andl	$992, %esi                      ## imm = 0x3E0
	orl	%ecx, %esi
	shll	$7, %edi
	andl	$31744, %edi                    ## imm = 0x7C00
	orl	%esi, %edi
	movl	%edi, (%rax)
	addq	$4, %rax
	addq	$12, %rdx
	cmpq	%r10, %rdx
	jb	LBB0_8
LBB0_9:
	popq	%rbx
	popq	%rbp
	retq
LBB0_5:
	addq	%rcx, %r8
	incq	%r8
	movq	%r8, %r9
	andq	$-4, %r9
	leaq	(%rsi,%r9,4), %rax
	leaq	(%r9,%r9,2), %rcx
	leaq	(%rdi,%rcx,4), %rdx
	xorl	%ecx, %ecx
	movdqa	LCPI0_0(%rip), %xmm0            ## xmm0 = [992,992,992,992]
	movdqa	LCPI0_1(%rip), %xmm1            ## xmm1 = [31744,31744,31744,31744]
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movdqu	(%rdi), %xmm2
	movdqu	16(%rdi), %xmm3
	movups	32(%rdi), %xmm4
	movdqa	%xmm3, %xmm5
	pblendw	$12, %xmm2, %xmm5               ## xmm5 = xmm5[0,1],xmm2[2,3],xmm5[4,5,6,7]
	pshufd	$238, %xmm2, %xmm6              ## xmm6 = xmm2[2,3,2,3]
	shufps	$236, %xmm3, %xmm2              ## xmm2 = xmm2[0,3],xmm3[2,3]
	insertps	$112, %xmm4, %xmm2              ## xmm2 = xmm2[0,1,2],xmm4[1]
	pshufd	$170, %xmm4, %xmm7              ## xmm7 = xmm4[2,2,2,2]
	pshufd	$241, %xmm5, %xmm5              ## xmm5 = xmm5[1,0,3,3]
	pblendw	$192, %xmm7, %xmm5              ## xmm5 = xmm5[0,1,2,3,4,5],xmm7[6,7]
	pblendw	$12, %xmm3, %xmm6               ## xmm6 = xmm6[0,1],xmm3[2,3],xmm6[4,5,6,7]
	shufps	$196, %xmm4, %xmm6              ## xmm6 = xmm6[0,1],xmm4[0,3]
	psrad	$3, %xmm2
	pslld	$2, %xmm5
	pand	%xmm0, %xmm5
	por	%xmm2, %xmm5
	pslld	$7, %xmm6
	pand	%xmm1, %xmm6
	por	%xmm5, %xmm6
	movdqu	%xmm6, (%rsi,%rcx,4)
	addq	$4, %rcx
	addq	$48, %rdi
	cmpq	%rcx, %r9
	jne	LBB0_6
## %bb.7:
	cmpq	%r9, %r8
	jne	LBB0_8
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_rgb24tobgr15_c
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rgb24tobgr15_c
_rgb24tobgr15_c:                        ; @rgb24tobgr15_c
	.cfi_startproc
; %bb.0:
                                        ; kill: def $w2 killed $w2 def $x2
	cmp	w2, #1
	b.lt	LBB0_9
; %bb.1:
	sxtw	x8, w2
	add	x9, x0, x8, lsl #2
	add	x10, x0, #12
	cmp	x9, x10
	csel	x8, x9, x10, hi
	sub	x8, x8, #12
	cmp	x8, x0
	cinc	x11, x0, ne
	sub	x12, x8, x11
	cmp	x8, x0
	mov	x11, #-6148914691236517206
	movk	x11, #43691
	umulh	x8, x12, x11
	lsr	x8, x8, #3
	cinc	x8, x8, ne
	cmp	x8, #15
	b.lo	LBB0_6
; %bb.2:
	cmp	x9, x10
	csel	x9, x9, x10, hi
	sub	x9, x9, #12
	cmp	x9, x0
	cinc	x10, x0, ne
	sub	x10, x9, x10
	cmp	x9, x0
	umulh	x9, x10, x11
	lsr	x9, x9, #3
	cinc	x9, x9, ne
	add	x10, x1, x9, lsl #2
	add	x10, x10, #4
	mov	w11, #12
	madd	x9, x9, x11, x0
	add	x9, x9, #12
	cmp	x9, x1
	ccmp	x10, x0, #0, hi
	b.hi	LBB0_6
; %bb.3:
	add	x10, x8, #1
	and	x11, x10, #0x7ffffffffffffff0
	add	x8, x1, x11, lsl #2
	mov	w9, #12
	madd	x9, x11, x9, x0
	add	x12, x1, #32
	add	x13, x0, #96
	mov	w14, #992
	dup.4s	v0, w14
	movi.4s	v1, #124, lsl #8
	mov	x14, x11
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	sub	x15, x13, #96
	sub	x16, x13, #48
	ld3.4s	{ v2, v3, v4 }, [x15]
	ld3.4s	{ v5, v6, v7 }, [x16]
	mov	x15, x13
	ld3.4s	{ v16, v17, v18 }, [x15], #48
	ld3.4s	{ v19, v20, v21 }, [x15]
	sshr.4s	v22, v2, #3
	sshr.4s	v23, v5, #3
	sshr.4s	v24, v16, #3
	sshr.4s	v25, v19, #3
	shl.4s	v26, v3, #2
	shl.4s	v27, v6, #2
	shl.4s	v28, v17, #2
	shl.4s	v29, v20, #2
	and.16b	v26, v26, v0
	and.16b	v27, v27, v0
	and.16b	v28, v28, v0
	and.16b	v29, v29, v0
	orr.16b	v22, v26, v22
	orr.16b	v23, v27, v23
	orr.16b	v24, v28, v24
	orr.16b	v25, v29, v25
	shl.4s	v2, v4, #7
	shl.4s	v3, v7, #7
	shl.4s	v4, v18, #7
	shl.4s	v5, v21, #7
	and.16b	v2, v2, v1
	and.16b	v3, v3, v1
	and.16b	v4, v4, v1
	and.16b	v5, v5, v1
	orr.16b	v2, v22, v2
	orr.16b	v3, v23, v3
	orr.16b	v4, v24, v4
	stp	q2, q3, [x12, #-32]
	orr.16b	v2, v25, v5
	stp	q4, q2, [x12], #64
	add	x13, x13, #192
	subs	x14, x14, #16
	b.ne	LBB0_4
; %bb.5:
	cmp	x10, x11
	b.ne	LBB0_7
	b	LBB0_9
LBB0_6:
	mov	x8, x1
	mov	x9, x0
LBB0_7:
	add	x10, x0, w2, sxtw #2
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldp	w11, w12, [x9]
	ldr	w13, [x9, #8]
	lsl	w12, w12, #2
	and	w12, w12, #0x3e0
	orr	w11, w12, w11, asr #3
	lsl	w12, w13, #7
	and	w12, w12, #0x7c00
	orr	w11, w11, w12
	str	w11, [x8], #4
	add	x9, x9, #12
	cmp	x9, x10
	b.lo	LBB0_8
LBB0_9:
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_rgb24tobgr15_c
.subsections_via_symbols
