	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function rgb15tobgr32
LCPI0_0:
	.long	31744                           ## 0x7c00
	.long	31744                           ## 0x7c00
	.long	31744                           ## 0x7c00
	.long	31744                           ## 0x7c00
LCPI0_1:
	.long	992                             ## 0x3e0
	.long	992                             ## 0x3e0
	.long	992                             ## 0x3e0
	.long	992                             ## 0x3e0
LCPI0_2:
	.long	31                              ## 0x1f
	.long	31                              ## 0x1f
	.long	31                              ## 0x1f
	.long	31                              ## 0x1f
LCPI0_3:
	.long	255                             ## 0xff
	.long	255                             ## 0xff
	.long	255                             ## 0xff
	.long	255                             ## 0xff
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_rgb15tobgr32
	.p2align	4, 0x90
_rgb15tobgr32:                          ## @rgb15tobgr32
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	cmpl	$2, %edx
	jl	LBB0_9
## %bb.1:
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	cltq
	leaq	(%rdi,%rax,4), %r10
	leaq	4(%rdi), %rax
	cmpq	%rax, %r10
	movq	%rax, %r8
	cmovaq	%r10, %r8
	movq	%rdi, %rcx
	notq	%rcx
	addq	%rcx, %r8
	cmpq	$12, %r8
	jb	LBB0_2
## %bb.3:
	cmpq	%rax, %r10
	cmovaq	%r10, %rax
	leaq	(%rax,%rcx), %rdx
	andq	$-4, %rdx
	addq	%rdi, %rdx
	addq	$4, %rdx
	cmpq	%rsi, %rdx
	jbe	LBB0_5
## %bb.4:
	addq	%rcx, %rax
	addq	$4, %rax
	movabsq	$4611686018427387900, %rcx      ## imm = 0x3FFFFFFFFFFFFFFC
	andq	%rax, %rcx
	leaq	(%rsi,%rcx,4), %rax
	cmpq	%rdi, %rax
	jbe	LBB0_5
LBB0_2:
	movq	%rsi, %rcx
	movq	%rdi, %rdx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rdx), %eax
	addq	$4, %rdx
	movl	%eax, %esi
	andl	$31744, %esi                    ## imm = 0x7C00
	movl	%esi, %edi
	shrl	$7, %edi
	shrl	$12, %esi
	orl	%edi, %esi
	movl	%esi, (%rcx)
	movl	%eax, %esi
	andl	$992, %esi                      ## imm = 0x3E0
	movl	%esi, %edi
	shrl	$2, %edi
	shrl	$7, %esi
	orl	%edi, %esi
	movl	%esi, 4(%rcx)
	andl	$31, %eax
	movl	%eax, %esi
	shrl	$2, %esi
	leal	(%rsi,%rax,8), %eax
	movl	%eax, 8(%rcx)
	movl	$255, 12(%rcx)
	addq	$16, %rcx
	cmpq	%r10, %rdx
	jb	LBB0_8
LBB0_9:
	popq	%rbp
	retq
LBB0_5:
	shrq	$2, %r8
	incq	%r8
	movq	%r8, %r9
	andq	$-4, %r9
	movq	%r9, %rcx
	shlq	$4, %rcx
	addq	%rsi, %rcx
	leaq	(%rdi,%r9,4), %rdx
	xorl	%eax, %eax
	movdqa	LCPI0_0(%rip), %xmm8            ## xmm8 = [31744,31744,31744,31744]
	movdqa	LCPI0_1(%rip), %xmm9            ## xmm9 = [992,992,992,992]
	movdqa	LCPI0_2(%rip), %xmm10           ## xmm10 = [31,31,31,31]
	movdqa	LCPI0_3(%rip), %xmm2            ## xmm2 = [255,255,255,255]
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movdqu	(%rdi,%rax,4), %xmm5
	movdqa	%xmm5, %xmm4
	pand	%xmm8, %xmm4
	movdqa	%xmm4, %xmm6
	psrld	$7, %xmm6
	psrld	$12, %xmm4
	por	%xmm6, %xmm4
	movdqa	%xmm5, %xmm6
	pand	%xmm9, %xmm6
	movdqa	%xmm6, %xmm7
	psrld	$2, %xmm7
	psrld	$7, %xmm6
	por	%xmm7, %xmm6
	pand	%xmm10, %xmm5
	movdqa	%xmm5, %xmm7
	pslld	$3, %xmm7
	psrld	$2, %xmm5
	por	%xmm7, %xmm5
	movdqa	%xmm6, %xmm7
	shufps	$0, %xmm5, %xmm7                ## xmm7 = xmm7[0,0],xmm5[0,0]
	movdqa	%xmm4, %xmm0
	pblendw	$240, %xmm2, %xmm0              ## xmm0 = xmm0[0,1,2,3],xmm2[4,5,6,7]
	pblendw	$60, %xmm7, %xmm0               ## xmm0 = xmm0[0,1],xmm7[2,3,4,5],xmm0[6,7]
	movdqa	%xmm6, %xmm7
	insertps	$105, %xmm5, %xmm7              ## xmm7 = zero,xmm7[1],xmm5[1],zero
	movdqa	%xmm2, %xmm3
	insertps	$70, %xmm4, %xmm3               ## xmm3 = xmm4[1],zero,zero,xmm3[3]
	orps	%xmm7, %xmm3
	movaps	%xmm5, %xmm7
	insertps	$153, %xmm6, %xmm7              ## xmm7 = zero,xmm6[2],xmm7[2],zero
	movdqa	%xmm2, %xmm1
	insertps	$198, %xmm4, %xmm1              ## xmm1 = xmm4[3],zero,zero,xmm1[3]
	punpckhqdq	%xmm2, %xmm4            ## xmm4 = xmm4[1],xmm2[1]
	pblendw	$60, %xmm7, %xmm4               ## xmm4 = xmm4[0,1],xmm7[2,3,4,5],xmm4[6,7]
	shufps	$255, %xmm5, %xmm6              ## xmm6 = xmm6[3,3],xmm5[3,3]
	blendps	$9, %xmm1, %xmm6                ## xmm6 = xmm1[0],xmm6[1,2],xmm1[3]
	movups	%xmm6, 48(%rsi)
	movdqu	%xmm4, 32(%rsi)
	movups	%xmm3, 16(%rsi)
	movdqu	%xmm0, (%rsi)
	addq	$4, %rax
	addq	$64, %rsi
	cmpq	%rax, %r9
	jne	LBB0_6
## %bb.7:
	cmpq	%r9, %r8
	jne	LBB0_8
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function rgb15tobgr32
lCPI0_0:
	.long	31744                           ; 0x7c00
	.long	992                             ; 0x3e0
lCPI0_1:
	.long	4294967289                      ; 0xfffffff9
	.long	4294967294                      ; 0xfffffffe
lCPI0_2:
	.long	4294967284                      ; 0xfffffff4
	.long	4294967289                      ; 0xfffffff9
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_rgb15tobgr32
	.p2align	2
_rgb15tobgr32:                          ; @rgb15tobgr32
	.cfi_startproc
; %bb.0:
	stp	d11, d10, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	d9, d8, [sp, #16]               ; 16-byte Folded Spill
	.cfi_offset b8, -8
	.cfi_offset b9, -16
	.cfi_offset b10, -24
	.cfi_offset b11, -32
	cmp	w2, #0
	cinc	w9, w2, lt
	cmp	w2, #2
	b.lt	LBB0_9
; %bb.1:
	sbfx	x8, x9, #1, #31
	add	x10, x0, x8, lsl #2
	add	x11, x0, #4
	cmp	x10, x11
	csel	x8, x10, x11, hi
	mvn	x12, x0
	add	x8, x8, x12
	cmp	x8, #60
	b.lo	LBB0_6
; %bb.2:
	cmp	x10, x11
	csel	x10, x10, x11, hi
	add	x10, x10, x12
	and	x11, x10, #0xfffffffffffffffc
	add	x10, x10, #4
	and	x10, x10, #0x3ffffffffffffffc
	add	x10, x1, x10, lsl #2
	add	x11, x11, x0
	add	x11, x11, #4
	cmp	x11, x1
	ccmp	x10, x0, #0, hi
	b.hi	LBB0_6
; %bb.3:
	lsr	x8, x8, #2
	add	x11, x8, #1
	and	x12, x11, #0x7ffffffffffffff0
	add	x8, x1, x12, lsl #4
	add	x10, x0, x12, lsl #2
	add	x14, x1, #128
	add	x13, x0, #32
	movi.4s	v0, #124, lsl #8
	mov	w15, #992
	dup.4s	v1, w15
	movi.4s	v2, #31
	movi.2d	v6, #0x0000ff000000ff
	mov	x15, x12
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldp	q7, q16, [x13, #-32]
	and.16b	v17, v7, v0
	and.16b	v18, v16, v0
	ldp	q19, q20, [x13], #64
	and.16b	v21, v19, v0
	and.16b	v22, v20, v0
	ushr.4s	v23, v17, #7
	ushr.4s	v24, v18, #7
	ushr.4s	v25, v21, #7
	ushr.4s	v26, v22, #7
	ushr.4s	v17, v17, #12
	ushr.4s	v18, v18, #12
	ushr.4s	v21, v21, #12
	ushr.4s	v22, v22, #12
	orr.16b	v3, v23, v17
	and.16b	v17, v7, v1
	ushr.4s	v23, v17, #2
	ushr.4s	v17, v17, #7
	orr.16b	v4, v23, v17
	and.16b	v7, v7, v2
	shl.4s	v17, v7, #3
	ushr.4s	v7, v7, #2
	orr.16b	v5, v17, v7
	orr.16b	v27, v24, v18
	and.16b	v7, v16, v1
	ushr.4s	v17, v7, #2
	ushr.4s	v7, v7, #7
	orr.16b	v28, v17, v7
	and.16b	v7, v16, v2
	shl.4s	v16, v7, #3
	ushr.4s	v7, v7, #2
	orr.16b	v29, v16, v7
	mov.16b	v30, v6
	orr.16b	v7, v25, v21
	and.16b	v16, v19, v1
	ushr.4s	v17, v16, #2
	ushr.4s	v16, v16, #7
	orr.16b	v8, v17, v16
	and.16b	v16, v19, v2
	shl.4s	v17, v16, #3
	ushr.4s	v16, v16, #2
	orr.16b	v9, v17, v16
	mov.16b	v10, v6
	orr.16b	v16, v26, v22
	and.16b	v21, v20, v1
	ushr.4s	v22, v21, #2
	ushr.4s	v21, v21, #7
	orr.16b	v17, v22, v21
	and.16b	v20, v20, v2
	sub	x16, x14, #128
	sub	x17, x14, #64
	st4.4s	{ v3, v4, v5, v6 }, [x16]
	st4.4s	{ v27, v28, v29, v30 }, [x17]
	shl.4s	v21, v20, #3
	ushr.4s	v20, v20, #2
	orr.16b	v18, v21, v20
	mov.16b	v19, v6
	add	x16, x14, #256
	st4.4s	{ v7, v8, v9, v10 }, [x14], #64
	st4.4s	{ v16, v17, v18, v19 }, [x14]
	mov	x14, x16
	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	x10, x0
LBB0_7:
	asr	w9, w9, #1
	add	x9, x0, w9, sxtw #2
Lloh0:
	adrp	x11, lCPI0_0@PAGE
Lloh1:
	ldr	d0, [x11, lCPI0_0@PAGEOFF]
Lloh2:
	adrp	x11, lCPI0_1@PAGE
Lloh3:
	ldr	d1, [x11, lCPI0_1@PAGEOFF]
Lloh4:
	adrp	x11, lCPI0_2@PAGE
Lloh5:
	ldr	d2, [x11, lCPI0_2@PAGEOFF]
	mov	w11, #255
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w12, [x10], #4
	dup.2s	v3, w12
	and.8b	v3, v3, v0
	ushl.2s	v4, v3, v1
	ushl.2s	v3, v3, v2
	orr.8b	v3, v4, v3
	str	d3, [x8]
	and	w13, w12, #0x1f
	ubfx	w12, w12, #2, #3
	bfi	w12, w13, #3, #5
	stp	w12, w11, [x8, #8]
	add	x8, x8, #16
	cmp	x10, x9
	b.lo	LBB0_8
LBB0_9:
	ldp	d9, d8, [sp, #16]               ; 16-byte Folded Reload
	ldp	d11, d10, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdr	Lloh4, Lloh5
	.loh AdrpAdrp	Lloh2, Lloh4
	.loh AdrpLdr	Lloh2, Lloh3
	.loh AdrpAdrp	Lloh0, Lloh2
	.loh AdrpLdr	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
