	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function conv_bgr24_rgb565
LCPI0_0:
	.long	63488                           ## 0xf800
	.long	63488                           ## 0xf800
	.long	63488                           ## 0xf800
	.long	63488                           ## 0xf800
LCPI0_1:
	.long	2016                            ## 0x7e0
	.long	2016                            ## 0x7e0
	.long	2016                            ## 0x7e0
	.long	2016                            ## 0x7e0
LCPI0_2:
	.long	31                              ## 0x1f
	.long	31                              ## 0x1f
	.long	31                              ## 0x1f
	.long	31                              ## 0x1f
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_conv_bgr24_rgb565
	.p2align	4, 0x90
_conv_bgr24_rgb565:                     ## @conv_bgr24_rgb565
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	testl	%ecx, %ecx
	jle	LBB0_13
## %bb.1:
	movslq	%r8d, %r14
	movslq	%r9d, %rax
	movl	%edx, %r8d
	shlq	$2, %r14
	leaq	(,%r8,4), %rsi
	shlq	$2, %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%rsi, -88(%rbp)                 ## 8-byte Spill
	leaq	(%rsi,%rsi,2), %rax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movl	%r8d, %eax
	andl	$-4, %eax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	leaq	(%rax,%rax,2), %r15
	xorl	%r12d, %r12d
	movl	$252, %r13d
	movdqa	LCPI0_0(%rip), %xmm8            ## xmm8 = [63488,63488,63488,63488]
	movdqa	LCPI0_1(%rip), %xmm1            ## xmm1 = [2016,2016,2016,2016]
	movdqa	LCPI0_2(%rip), %xmm2            ## xmm2 = [31,31,31,31]
	movq	-64(%rbp), %r9                  ## 8-byte Reload
	movq	-56(%rbp), %r10                 ## 8-byte Reload
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_2 Depth=1
	incq	%r12
	addq	-72(%rbp), %r9                  ## 8-byte Folded Reload
	addq	%r14, %r10
	cmpl	%ecx, %r12d
	je	LBB0_13
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_9 Depth 2
                                        ##     Child Loop BB0_11 Depth 2
	testl	%edx, %edx
	jle	LBB0_12
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$4, %edx
	jae	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%edi, %edi
	movq	%r9, %r11
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r14, %rdi
	imulq	%r12, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	leaq	(%rsi,%rdi), %r14
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	imulq	%r12, %rbx
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%rbx), %r11
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	addq	%rax, %r11
	cmpq	%r11, %r14
	jae	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	addq	-88(%rbp), %rdi                 ## 8-byte Folded Reload
	addq	%rsi, %rdi
	addq	%rax, %rbx
	cmpq	%rdi, %rbx
	jae	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%edi, %edi
	movq	%r9, %r11
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_11
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	leaq	(%r9,%r15,4), %r11
	xorl	%r14d, %r14d
	movq	%r10, %rdi
	.p2align	4, 0x90
LBB0_9:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movdqu	(%r9,%r14,4), %xmm3
	movdqu	16(%r9,%r14,4), %xmm4
	movups	32(%r9,%r14,4), %xmm5
	movdqa	%xmm4, %xmm6
	pblendw	$12, %xmm3, %xmm6               ## xmm6 = xmm6[0,1],xmm3[2,3],xmm6[4,5,6,7]
	pshufd	$238, %xmm3, %xmm7              ## xmm7 = xmm3[2,3,2,3]
	shufps	$236, %xmm4, %xmm3              ## xmm3 = xmm3[0,3],xmm4[2,3]
	insertps	$112, %xmm5, %xmm3              ## xmm3 = xmm3[0,1,2],xmm5[1]
	pshufd	$170, %xmm5, %xmm0              ## xmm0 = xmm5[2,2,2,2]
	pshufd	$241, %xmm6, %xmm6              ## xmm6 = xmm6[1,0,3,3]
	pblendw	$192, %xmm0, %xmm6              ## xmm6 = xmm6[0,1,2,3,4,5],xmm0[6,7]
	pblendw	$12, %xmm4, %xmm7               ## xmm7 = xmm7[0,1],xmm4[2,3],xmm7[4,5,6,7]
	shufps	$196, %xmm5, %xmm7              ## xmm7 = xmm7[0,1],xmm5[0,3]
	pslld	$8, %xmm7
	pand	%xmm8, %xmm7
	pslld	$3, %xmm6
	pand	%xmm1, %xmm6
	psrld	$3, %xmm3
	pand	%xmm2, %xmm3
	por	%xmm6, %xmm3
	por	%xmm7, %xmm3
	movdqu	%xmm3, (%rdi)
	addq	$16, %rdi
	addq	$12, %r14
	cmpq	%r14, %r15
	jne	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, %rdi
	cmpq	%r8, %rax
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	je	LBB0_12
	.p2align	4, 0x90
LBB0_11:                                ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r11), %eax
	movl	8(%r11), %ebx
	shll	$8, %ebx
	andl	$63488, %ebx                    ## imm = 0xF800
	movl	4(%r11), %esi
	andl	%r13d, %esi
	shrl	$3, %eax
	andl	$31, %eax
	leal	(%rax,%rsi,8), %eax
	orl	%ebx, %eax
	movl	%eax, (%r10,%rdi,4)
	incq	%rdi
	addq	$12, %r11
	cmpq	%rdi, %r8
	jne	LBB0_11
	jmp	LBB0_12
LBB0_13:
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	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	_conv_bgr24_rgb565              ; -- Begin function conv_bgr24_rgb565
	.p2align	2
_conv_bgr24_rgb565:                     ; @conv_bgr24_rgb565
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	.cfi_offset w19, -8
	.cfi_offset w20, -16
	.cfi_offset w21, -24
	.cfi_offset w22, -32
                                        ; kill: def $w5 killed $w5 def $x5
                                        ; kill: def $w4 killed $w4 def $x4
	cmp	w3, #1
	b.lt	LBB0_11
; %bb.1:
	mov	x8, #0
	sxtw	x9, w5
	mov	w10, w2
	sbfiz	x11, x4, #2, #32
	lsl	x12, x10, #2
	sbfiz	x13, x5, #2, #32
	add	x14, x10, w2, uxtw #1
	lsl	x14, x14, #2
	and	x15, x10, #0xfffffff0
	and	x16, x12, #0x3ffffffc0
	add	x17, x1, #96
	movi.4s	v0, #248, lsl #8
	mov	w4, #2016
	dup.4s	v1, w4
	movi.4s	v2, #31
	mov	x4, x0
	mov	x5, x1
	add	x6, x15, x15, lsl #1
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x8, x8, #1
	add	x5, x5, x9, lsl #2
	add	x17, x17, x13
	add	x4, x4, x11
	cmp	w8, w3
	b.eq	LBB0_11
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
                                        ;     Child Loop BB0_10 Depth 2
	cmp	w2, #1
	b.lt	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	cmp	w2, #16
	b.lo	LBB0_9
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	mul	x7, x11, x8
	add	x19, x12, x7
	add	x19, x0, x19
	mul	x20, x13, x8
	add	x21, x1, x20
	add	x20, x14, x20
	add	x20, x1, x20
	add	x7, x0, x7
	cmp	x7, x20
	ccmp	x21, x19, #2, lo
	b.lo	LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x19, #0
	add	x7, x5, x6, lsl #2
	mov	x20, x17
LBB0_7:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	sub	x21, x20, #96
	sub	x22, x20, #48
	ld3.4s	{ v3, v4, v5 }, [x21]
	ld3.4s	{ v16, v17, v18 }, [x22]
	mov	x21, x20
	ld3.4s	{ v19, v20, v21 }, [x21], #48
	ld3.4s	{ v22, v23, v24 }, [x21]
	shl.4s	v6, v5, #8
	shl.4s	v7, v18, #8
	shl.4s	v25, v21, #8
	shl.4s	v26, v24, #8
	and.16b	v6, v6, v0
	and.16b	v7, v7, v0
	and.16b	v25, v25, v0
	and.16b	v26, v26, v0
	shl.4s	v27, v4, #3
	shl.4s	v28, v17, #3
	shl.4s	v29, v20, #3
	shl.4s	v30, v23, #3
	and.16b	v27, v27, v1
	and.16b	v28, v28, v1
	and.16b	v29, v29, v1
	and.16b	v30, v30, v1
	ushr.4s	v3, v3, #3
	ushr.4s	v4, v16, #3
	ushr.4s	v5, v19, #3
	ushr.4s	v16, v22, #3
	and.16b	v3, v3, v2
	and.16b	v4, v4, v2
	and.16b	v5, v5, v2
	and.16b	v16, v16, v2
	orr.16b	v3, v27, v3
	orr.16b	v4, v28, v4
	orr.16b	v5, v29, v5
	orr.16b	v16, v30, v16
	orr.16b	v3, v3, v6
	orr.16b	v4, v4, v7
	orr.16b	v5, v5, v25
	orr.16b	v6, v16, v26
	add	x21, x4, x19
	stp	q3, q4, [x21]
	stp	q5, q6, [x21, #32]
	add	x19, x19, #64
	add	x20, x20, #192
	cmp	x16, x19
	b.ne	LBB0_7
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x19, x15
	cmp	x15, x10
	b.ne	LBB0_10
	b	LBB0_2
LBB0_9:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x19, #0
	mov	x7, x5
LBB0_10:                                ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldp	w20, w21, [x7]
	ldr	w22, [x7, #8]
	lsr	w22, w22, #3
	lsl	w21, w21, #3
	and	w21, w21, #0x7e0
	bfxil	w21, w20, #3, #5
	bfi	w21, w22, #11, #5
	str	w21, [x4, x19, lsl #2]
	add	x19, x19, #1
	add	x7, x7, #12
	cmp	x10, x19
	b.ne	LBB0_10
	b	LBB0_2
LBB0_11:
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #32             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
